mirror of https://github.com/django/django.git
Removed redundant filtering in date_hierarchy template tag.
cl.queryset is already filtered by the current selections.
This commit is contained in:
parent
5a669ae2f4
commit
2014db50f4
|
@ -370,8 +370,7 @@ def date_hierarchy(cl):
|
||||||
'choices': [{'title': capfirst(formats.date_format(day, 'MONTH_DAY_FORMAT'))}]
|
'choices': [{'title': capfirst(formats.date_format(day, 'MONTH_DAY_FORMAT'))}]
|
||||||
}
|
}
|
||||||
elif year_lookup and month_lookup:
|
elif year_lookup and month_lookup:
|
||||||
days = cl.queryset.filter(**{year_field: year_lookup, month_field: month_lookup})
|
days = getattr(cl.queryset, 'dates')(field_name, 'day')
|
||||||
days = getattr(days, 'dates')(field_name, 'day')
|
|
||||||
return {
|
return {
|
||||||
'show': True,
|
'show': True,
|
||||||
'back': {
|
'back': {
|
||||||
|
@ -384,8 +383,7 @@ def date_hierarchy(cl):
|
||||||
} for day in days]
|
} for day in days]
|
||||||
}
|
}
|
||||||
elif year_lookup:
|
elif year_lookup:
|
||||||
months = cl.queryset.filter(**{year_field: year_lookup})
|
months = getattr(cl.queryset, 'dates')(field_name, 'month')
|
||||||
months = getattr(months, 'dates')(field_name, 'month')
|
|
||||||
return {
|
return {
|
||||||
'show': True,
|
'show': True,
|
||||||
'back': {
|
'back': {
|
||||||
|
|
Loading…
Reference in New Issue