1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2024-12-29 03:02:23 +00:00
med/search/forms.py
2019-08-02 21:35:30 +02:00

27 lines
953 B
Python

# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2017-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django import forms
from django.forms import Form
CHOICES2 = (
('0', 'Utilisateurs'),
('1', 'Media'),
('2', 'Emprunts'),
('3', 'Jeu'),
)
class SearchForm(Form):
search_field = forms.CharField(label='Search', max_length=100)
class SearchFormPlus(Form):
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'])
date_fin = forms.DateField(required=False, help_text='DD/MM/YYYY', input_formats=['%d/%m/%Y'], label="Date de fin")