Login form avec plus de 30 chars
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / chercheurs / forms.py
CommitLineData
932eef9a
AJ
1# -*- encoding: utf-8 -*-
2from django import forms
3from models import *
4
13146d99 5
932eef9a 6class PersonneForm(forms.ModelForm):
c18af6bd
AJ
7 password = forms.CharField(widget=forms.PasswordInput(), label="Mot de passe")
8 genre = forms.ChoiceField(widget=forms.RadioSelect(), choices=GENRE_CHOICES)
932eef9a 9 class Meta:
dab519fa
AJ
10 model = Utilisateur
11 fields = ('nom', 'prenom', 'courriel', 'password', 'genre')
5ecd9e43 12
932eef9a
AJ
13
14class ChercheurForm(forms.ModelForm):
15 class Meta:
16 model = Chercheur
6befc7c9 17 fields = ('groupes',)
7c596de2 18
00755d9b
AJ
19class PublicationForm(forms.ModelForm):
20 class Meta:
21 model = Publication
6befc7c9 22 fields = ('titre', 'annee', 'revue', 'editeur', 'lieu_edition', 'nb_pages', 'url')
f810842d
AJ
23
24class TheseForm(PublicationForm):
25 titre = forms.CharField(required=True, label="Titre")
26 #def clean_titre(self):
27 # data = self.cleaned_data['titre']
28 # if not data:
29 # raise forms.ValidationError("Vous devez renseigner une thèse")
30 # return data
dab519fa 31
7c596de2
AJ
32class EtablissementForm(forms.ModelForm):
33 class Meta:
34 model = Chercheur
35 fields = ('etablissement',)
36
00755d9b
AJ
37class EtablissementAutreForm(forms.ModelForm):
38 class Meta:
39 model = Chercheur
40 fields = ('etablissement_autre_nom', 'etablissement_autre_pays', )
41
7c596de2
AJ
42class DisciplineForm(forms.ModelForm):
43 class Meta:
44 model = Chercheur
5ecd9e43 45 fields = ('discipline', 'expertise', 'mots_cles', 'url_site_web', 'url_blog', 'url_facebook', 'url_linkedin')
13146d99 46
b3e1079e
AJ
47class PersonneEditForm(forms.ModelForm):
48 class Meta:
49 model = Personne
50 fields = ('nom', 'prenom', 'genre')
51
13146d99
AJ
52
53class RepertoireSearchForm (forms.Form):
510b5321
AJ
54 mots_cles = forms.CharField (required = False, label="Mots-clés")
55 discipline = forms.ModelChoiceField(queryset=Discipline.objects.all(), required=False, label="Discipline", empty_label="Tous")
13146d99
AJ
56 fonction = forms.ChoiceField(choices=(('','Tous'),)+FONCTION_CHOICES, required=False, label="Fonction")
57 pays = forms.ModelChoiceField(queryset=Pays.objects.all().order_by("nom"), required=False, label="Localisation", empty_label="Tous")
510b5321 58 genre = forms.ChoiceField(choices=(('','Tous'),)+GENRE_CHOICES, required=False, label="Genre")