repertoire chercheurs ajustements
[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 = ('groupes',)
17
18 class PublicationForm(forms.ModelForm):
19 class Meta:
20 model = Publication
21 fields = ('titre', 'annee', 'revue', 'editeur', 'lieu_edition', 'nb_pages', 'url')
22
23 class EtablissementForm(forms.ModelForm):
24 class Meta:
25 model = Chercheur
26 fields = ('etablissement',)
27
28 class EtablissementAutreForm(forms.ModelForm):
29 class Meta:
30 model = Chercheur
31 fields = ('etablissement_autre_nom', 'etablissement_autre_pays', )
32
33 class DisciplineForm(forms.ModelForm):
34 class Meta:
35 model = Chercheur
36 fields = ('discipline', 'expertise', 'mots_cles', 'url_site_web', 'url_blog', 'url_facebook', 'url_linkedin')
37
38 class PersonneEditForm(forms.ModelForm):
39 class Meta:
40 model = Personne
41 fields = ('nom', 'prenom', 'genre')
42
43
44 class RepertoireSearchForm (forms.Form):
45 mots_cles = forms.CharField (required = False, label="Mots-clés")
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")