ajout champ disciplinaire, modif ordre champs de recherche
[auf_beco.git] / project / scholarships / filters.py
CommitLineData
cd6a0370 1# -*- encoding: utf-8 -*-
565ab071 2
565ab071 3from django_filters.filterset import FilterSet
565ab071 4from django_filters.filters import RangeFilter, CharFilter
565ab071
CD
5from django.utils.translation import ugettext_lazy as _
6
92481620
DB
7from project.scholarships.models import Scholarship
8from project.utils.extra_filters import AutoCompleteFilter
9
565ab071
CD
10class ScholarshipFilter(FilterSet):
11 class Meta:
12 model = Scholarship
fe8dcf40
CD
13 fields = ['scholarship_type', 'year_accepted', 'sender_institution', 'sender_town', 'sender_country',
14 'beneficiary',
15 'sender_office', 'sender_department',
18b73b8b
TNP
16 'receiver_office', 'receiver_institution', 'receiver_department', 'receiver_town', 'receiver_country',
17 'supported_duration_count', 'supported_amount',
040a2f6d 18 'title', 'disciplines', 'champ_disciplinaire', 'comments']
1260958b 19
fe8dcf40 20 beneficiary = AutoCompleteFilter(channel = "betterscholarship_receiver", label = _(u"Bénéficiaire"))
154d861a 21 year_accepted = RangeFilter(label = _(u"Année d'acceptation"))
18b73b8b 22 sender_institution = AutoCompleteFilter(channel = "institution_university", label = _(u"Etablissement d'origine"))
060aa45e 23 sender_department = AutoCompleteFilter(channel = "department", label = _(u"Faculté d'origine"))
154d861a 24 sender_town = CharFilter(lookup_type = "icontains", label = _(u"Ville d'origine"))
565ab071 25
cb47ac24 26 receiver_institution = AutoCompleteFilter(channel = "institution_university", label = _(u"Etablissement d'accueil"))
154d861a 27 receiver_department = AutoCompleteFilter(channel = "department", label = _(u"Faculté d'accueil"))
18b73b8b 28 receiver_town = CharFilter(lookup_type = "icontains", label = _(u"Ville d'accueil"))
565ab071 29
fe8dcf40
CD
30# supported_duration_count = RangeFilter(label = _(u"Durée financée"))
31# supported_amount = RangeFilter(label = _(u"Montant financé"))
32# title = CharFilter(lookup_type = "icontains", label = _(u"Titre"))
565ab071 33
73e6a6ad 34# disciplines = AutoCompleteFilter(channel = "discipline", label = _(u"Disciplines"))
fe8dcf40 35# comments = CharFilter(lookup_type = "icontains", label = _(u"Commentaire"))
565ab071 36