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
|
|
|
|
|
|
|
|
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)
|
|
|
|
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")
|