Ticket #13607: date_hierarchy_initialisation.3.diff
File date_hierarchy_initialisation.3.diff, 1.1 KB (added by , 14 years ago) |
---|
-
django/contrib/admin/templatetags/admin_list.py
225 225 226 226 link = lambda d: cl.get_query_string(d, [field_generic]) 227 227 228 if not (year_lookup or month_lookup or day_lookup): 229 # select appropriate start level 230 date_range = cl.query_set.aggregate(first=models.Min(field_name), 231 last =models.Max(field_name)) 232 if date_range['first'] and date_range['last']: 233 if date_range['first'].year == date_range['last'].year: 234 year_lookup = date_range['first'].year 235 if date_range['first'].month == date_range['last'].month: 236 month_lookup = date_range['first'].month 237 228 238 if year_lookup and month_lookup and day_lookup: 229 239 day = datetime.date(int(year_lookup), int(month_lookup), int(day_lookup)) 230 240 return {