non strict.
Par défaut, le filtrage est configuré sur aujourd'hui, soit les actifs
"""
+ date_borne_gauche = 'date_debut'
+ date_borne_droite = 'date_fin'
def get_changelist(self, request, **kwargs):
if request.META.has_key('HTTP_REFERER'):
referer = request.META['HTTP_REFERER']
if referer != reverse(change_list_view):
params = request.GET.copy()
today = datetime.date.today()
- params.update({'date_debut__gte' : str(today), 'date_fin__lte' : str(today) })
+ params.update({'%s__gte' % self.date_borne_gauche : str(today), '%s__lte' % self.date_borne_droite : str(today) })
request.GET = params
return ChangeList
form = EmployeAdminForm
list_display = ('_apercu', '_nom', '_dossiers', 'date_modification', 'user_modification', )
list_filter = ('rh_dossiers__poste__implantation__region', 'rh_dossiers__poste__implantation', 'nb_postes', 'rh_dossiers__date_debut', 'rh_dossiers__date_fin')
+ date_borne_gauche = 'rh_dossiers__date_debut'
+ date_borne_droite = 'rh_dossiers__date_fin'
inlines = (AyantDroitInline,
DossierROInline,
EmployePieceInline,
'date_debut__isnull',
'date_fin__lte',
'date_fin__isnull',
+ 'implantation__region__id__exact',
+ 'implantation__id__exact',
+ 'type_poste__id__exact',
+ 'type_poste__famille_emploi__id__exact',
+ 'service__id__exact',
+ 'vacant__exact',
):
return True