Vous voici sur le Git Rural du CRAW

Commit 7e28013c authored by Patrick Houben's avatar Patrick Houben

utils_tools.get_year_list LIST of str!

parent 938d7a56
......@@ -351,9 +351,9 @@ class ProductSearch(forms.Form):
class GraphParamForm(forms.Form):
LIST_YEAR = [
(2018, '2018'),
(2019, '2019'),
(2020, '2020'),
('2018', '2018'),
('2019', '2019'),
('2020', '2020'),
]
year1 = forms.ChoiceField(choices=LIST_YEAR, widget=forms.Select(attrs={'class': "form-control"}))
year2 = forms.ChoiceField(choices=LIST_YEAR, widget=forms.Select(attrs={'class': "form-control"}))
......
......@@ -55,7 +55,7 @@ def set_prevlast_year(request, myuser):
def get_year_list(request, which_list='BOTH'):
"""
in param is session list like [2018, 2019]
out param is a list of tuple like [(2018, '2018'), (2019, '2019')]
out param is a list of tuple like [('2018', '2018'), ('2019', '2019')]
No more used from 02/04/2020
"""
year_list_out = []
......@@ -70,7 +70,8 @@ def get_year_list(request, which_list='BOTH'):
result = set(rev_year_list)
for i in result:
line = (i, "{}".format(i))
# line = ("{}".format(i), "{}".format(i))
line = (str(i), str(i))
year_list_out.append(line)
return year_list_out
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment