CRUD evenement + admin
[auf_savoirs_en_partage_django.git] / auf_savoirs_en_partage / savoirs / forms.py
CommitLineData
544b4522
CR
1# -*- encoding: utf-8 -*-
2from django import forms
0a77a7d6 3from datamaster_modeles.models import Thematique, Pays, Region
4from models import Evenement, Discipline
544b4522
CR
5
6class RechercheAvancee (forms.Form):
7 creator = forms.CharField (max_length=60, required=False, \
8 label = "Auteur ou contributeur") # + contributor
9 title = forms.CharField (max_length=100, required=False, \
10 label = "Titre") # + alt_title
11 description = forms.CharField (max_length=100, required=False, \
12 label = "Description ou résumé") # + abstract
13 subject = forms.CharField (max_length=100, required=False, label = "Sujet")
14 operator = forms.ChoiceField (choices = (('or', 'ou'), ('and', 'et')), label = "Operateur")
15 type = forms.CharField (initial='avancee', required=False, widget=forms.HiddenInput)
16
17
92c7413b
CR
18class EvenementForm(forms.ModelForm):
19 class Meta:
20 model = Evenement
b7a741ad 21 exclude = ('approuve', 'uid')
0a77a7d6 22
23# Admin views pour les associations par lots
24
25class PaysForm(forms.Form):
26 values = [(p.id, p.nom) for p in Pays.objects.all()]
27 pays = forms.MultipleChoiceField(choices=values)
28
29class RegionsForm(forms.Form):
30 values = [(r.id, r.nom) for r in Region.objects.all()]
31 regions = forms.MultipleChoiceField(choices=values)
32
33class ThematiquesForm(forms.Form):
34 values = [(t.id, t.nom) for t in Thematique.objects.all()]
35 thematiques = forms.MultipleChoiceField(choices=values)
36
37class DisciplinesForm(forms.Form):
38 values = [(t.id, t.nom) for t in Discipline.objects.all()]
39 disciplines = forms.MultipleChoiceField(choices=values)
40
41class ConfirmationForm(forms.Form):
42 pass
43