1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-12-26 05:42:23 +00:00
med/search/forms.py

35 lines
1.2 KiB
Python
Raw Normal View History

2019-08-02 12:57:53 +00:00
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2017-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
2017-06-30 01:25:07 +00:00
from django import forms
from django.forms import Form
CHOICES = (
('0', 'Actifs'),
('1', 'Désactivés'),
('2', 'Archivés'),
)
CHOICES2 = (
('0', 'Utilisateurs'),
('1', 'Media'),
('2', 'Emprunts'),
2017-07-03 18:59:50 +00:00
('3', 'Jeu'),
2017-06-30 01:25:07 +00:00
)
2019-08-02 12:57:53 +00:00
2017-06-30 01:25:07 +00:00
class SearchForm(Form):
2019-08-02 12:57:53 +00:00
search_field = forms.CharField(label='Search', max_length=100)
2017-06-30 01:25:07 +00:00
class SearchFormPlus(Form):
2019-08-02 12:57:53 +00:00
search_field = forms.CharField(label='Search', max_length=100, required=False)
filtre = forms.MultipleChoiceField(label="Filtre utilisateurs", required=False, widget=forms.CheckboxSelectMultiple,
choices=CHOICES)
affichage = forms.MultipleChoiceField(label="Filtre affichage", required=False, widget=forms.CheckboxSelectMultiple,
choices=CHOICES2)
date_deb = forms.DateField(required=False, label="Date de début", help_text='DD/MM/YYYY',
input_formats=['%d/%m/%Y'])
2017-06-30 01:25:07 +00:00
date_fin = forms.DateField(required=False, help_text='DD/MM/YYYY', input_formats=['%d/%m/%Y'], label="Date de fin")