new file: news/__init__.py
[univ_ap.git] / news / forms.py
1 #-*- coding: utf-8 -*-
2 #!/usr/bin/env python
3
4
5 #import floppyforms as forms
6 from django import forms
7 from uni_form.helpers import FormHelper, Submit
8 from uni_form.helpers import Layout, Fieldset, Div, Column, Row, MultiField,HTML
9
10
11 from basemodel.models import Pays
12 from news.models import Categorie
13
14 class SearchActualiteForm(forms.Form):
15 helper = FormHelper()
16 pays = forms.ModelChoiceField(queryset = Pays.objects.filter(asie_pacifique=1),required=False)
17 categorie = forms.ModelChoiceField(required=False,queryset = Categorie.objects.all())
18 titre = forms.CharField(required=False,label = "Titre", )
19 date_debut = forms.DateField(required=False,label = u"Début publication (jj/mm/aaaa)")
20 date_fin = forms.DateField(required=False,label = "Fin publication (jj/mm/aaaa)", )
21 layout = Layout(Fieldset(u'Chercher une actualité','pays','categorie','titre'))
22 helper.add_layout(layout)
23 submit = Submit('submit','Rechercher',css_class='btn btn-success')
24 helper.add_input(submit)
25