Merge branch 'master' of ssh://gitosis@git.auf/auf_savoirs_en_partage_django
[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')
dab519fa 22
7c596de2
AJ
23class EtablissementForm(forms.ModelForm):
24 class Meta:
25 model = Chercheur
26 fields = ('etablissement',)
27
00755d9b
AJ
28class EtablissementAutreForm(forms.ModelForm):
29 class Meta:
30 model = Chercheur
31 fields = ('etablissement_autre_nom', 'etablissement_autre_pays', )
32
7c596de2
AJ
33class DisciplineForm(forms.ModelForm):
34 class Meta:
35 model = Chercheur
5ecd9e43 36 fields = ('discipline', 'expertise', 'mots_cles', 'url_site_web', 'url_blog', 'url_facebook', 'url_linkedin')
13146d99 37
b3e1079e
AJ
38class PersonneEditForm(forms.ModelForm):
39 class Meta:
40 model = Personne
41 fields = ('nom', 'prenom', 'genre')
42
13146d99
AJ
43
44class RepertoireSearchForm (forms.Form):
020b4d09 45 #mots_cles = forms.CharField (required = False, label="Mots-clés")
13146d99
AJ
46 discipline = forms.ModelChoiceField(queryset=Discipline.objects.all(), required=False, label="Champ disciplinaire", empty_label="Tous")
47 fonction = forms.ChoiceField(choices=(('','Tous'),)+FONCTION_CHOICES, required=False, label="Fonction")
48 pays = forms.ModelChoiceField(queryset=Pays.objects.all().order_by("nom"), required=False, label="Localisation", empty_label="Tous")
49 genre = forms.ChoiceField(choices=(('','Tous'),)+GENRE_CHOICES, required=False, label="Sexe")