@register.inclusion_tag('admin/rh/annee_select.html')
def recherche_par_annees(cl):
-
cursor = connection.cursor()
cursor.execute("SELECT year(date_debut) FROM rh_dossier WHERE year(date_debut) IS NOT NULL GROUP BY year(date_debut)")
set_annees = set(row[0] for row in cursor.fetchall())
widget=forms.Select(attrs = {
'onchange' : """window.location=window.location.pathname+this.options[this.selectedIndex].value""",
}))
- annee = forms.ChoiceField(choices=((cl.get_query_string({'annee': a}, {'periode', 'date_debut', 'date_fin'}), a) for a in list_annees),
+ annee = forms.ChoiceField(choices=((cl.get_query_string({'annee': a}, ('periode', 'date_debut', 'date_fin')), a) for a in list_annees),
widget=forms.Select(attrs = {
'onchange' : """window.location=window.location.pathname+this.options[this.selectedIndex].value""",
}))
f = RechercheTemporelle(params)
return {
'form': f,
- 'plage_date_querystring': cl.get_query_string(remove={'annee', 'periode'})
+ 'plage_date_querystring': cl.get_query_string(remove=('annee', 'periode'))
}