e8126b4713d22cfe1a53d2f355e3901d9a3be6d9
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / chercheurs / forms.py
1 # -*- encoding: utf-8 -*-
2 from django import forms
3 from models import *
4
5
6 class PersonneForm(forms.ModelForm):
7 password = forms.CharField(widget=forms.PasswordInput(), label="Mot de passe")
8 class Meta:
9 model = Utilisateur
10 fields = ('nom', 'prenom', 'courriel', 'password', 'genre')
11
12
13 class ChercheurForm(forms.ModelForm):
14 class Meta:
15 model = Chercheur
16 fields = ('nationalite', 'groupes')
17
18 class PublicationForm(forms.ModelForm):
19 class Meta:
20 model = Publication
21
22 class EtablissementForm(forms.ModelForm):
23 class Meta:
24 model = Chercheur
25 fields = ('etablissement',)
26
27 class EtablissementAutreForm(forms.ModelForm):
28 class Meta:
29 model = Chercheur
30 fields = ('etablissement_autre_nom', 'etablissement_autre_pays', )
31
32 class DisciplineForm(forms.ModelForm):
33 class Meta:
34 model = Chercheur
35 fields = ('discipline', 'expertise', 'mots_cles', 'url_site_web', 'url_blog', 'url_facebook', 'url_linkedin')
36
37 class PersonneEditForm(forms.ModelForm):
38 class Meta:
39 model = Personne
40 fields = ('nom', 'prenom', 'genre')
41
42
43 class RepertoireSearchForm (forms.Form):
44 mots_cles = forms.CharField (required = False, label="Mots-clés")
45 discipline = forms.ModelChoiceField(queryset=Discipline.objects.all(), required=False, label="Champ disciplinaire", empty_label="Tous")
46 fonction = forms.ChoiceField(choices=(('','Tous'),)+FONCTION_CHOICES, required=False, label="Fonction")
47 pays = forms.ModelChoiceField(queryset=Pays.objects.all().order_by("nom"), required=False, label="Localisation", empty_label="Tous")
48 genre = forms.ChoiceField(choices=(('','Tous'),)+GENRE_CHOICES, required=False, label="Sexe")