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