Edition des groupes dans fiche chercheur
[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 genre = forms.ChoiceField(widget=forms.RadioSelect(), choices=GENRE_CHOICES)
9 class Meta:
10 model = Utilisateur
11 fields = ('nom', 'prenom', 'courriel', 'password', 'genre')
12
13
14 class ChercheurForm(forms.ModelForm):
15 class Meta:
16 model = Chercheur
17 fields = ('groupes',)
18
19 class PublicationForm(forms.ModelForm):
20 class Meta:
21 model = Publication
22 fields = ('titre', 'annee', 'revue', 'editeur', 'lieu_edition', 'nb_pages', 'url')
23
24 class TheseForm(PublicationForm):
25 titre = forms.CharField(required=True, label="Titre")
26 class Meta:
27 model = Publication
28 fields = ('titre', 'annee', 'revue', 'editeur', 'lieu_edition', 'nb_pages', 'url')
29
30 class EtablissementForm(forms.ModelForm):
31 class Meta:
32 model = Chercheur
33 fields = ('etablissement',)
34
35 class EtablissementAutreForm(forms.ModelForm):
36 class Meta:
37 model = Chercheur
38 fields = ('etablissement_autre_nom', 'etablissement_autre_pays', )
39
40 class DisciplineForm(forms.ModelForm):
41 class Meta:
42 model = Chercheur
43 fields = ('discipline', 'expertise', 'mots_cles', 'url_site_web', 'url_blog', 'url_facebook', 'url_linkedin')
44
45 class PersonneEditForm(forms.ModelForm):
46 class Meta:
47 model = Personne
48 fields = ('nom', 'prenom', 'genre')
49
50
51 class RepertoireSearchForm (forms.Form):
52 mots_cles = forms.CharField (required = False, label="Mots-clés")
53 discipline = forms.ModelChoiceField(queryset=Discipline.objects.all(), required=False, label="Discipline", empty_label="Tous")
54 fonction = forms.ChoiceField(choices=(('','Tous'),)+FONCTION_CHOICES, required=False, label="Fonction")
55 pays = forms.ModelChoiceField(queryset=Pays.objects.all().order_by("nom"), required=False, label="Localisation", empty_label="Tous")
56 genre = forms.ChoiceField(choices=(('','Tous'),)+GENRE_CHOICES, required=False, label="Genre")