Edition basique d'un profil
[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 class Meta:
8 model = Utilisateur
9 fields = ('nom', 'prenom', 'courriel', 'password', 'genre')
10
11 class ChercheurForm(forms.ModelForm):
12 class Meta:
13 model = Chercheur
14 fields = ('pays', 'groupes')
15
16
17 class EtablissementForm(forms.ModelForm):
18 class Meta:
19 model = Chercheur
20 fields = ('etablissement',)
21
22 class DisciplineForm(forms.ModelForm):
23 class Meta:
24 model = Chercheur
25 fields = ('discipline', 'expertise', 'mots_cles', 'url', 'publication1', 'publication2', 'publication3')
26
27 class PersonneEditForm(forms.ModelForm):
28 class Meta:
29 model = Personne
30 fields = ('nom', 'prenom', 'genre')
31
32
33 class RepertoireSearchForm (forms.Form):
34 mots_cles = forms.CharField (required = False, label="Mots-clés")
35 discipline = forms.ModelChoiceField(queryset=Discipline.objects.all(), required=False, label="Champ disciplinaire", empty_label="Tous")
36 fonction = forms.ChoiceField(choices=(('','Tous'),)+FONCTION_CHOICES, required=False, label="Fonction")
37 pays = forms.ModelChoiceField(queryset=Pays.objects.all().order_by("nom"), required=False, label="Localisation", empty_label="Tous")
38 genre = forms.ChoiceField(choices=(('','Tous'),)+GENRE_CHOICES, required=False, label="Sexe")