Ticket #13607: date_hierarchy_initialisation.2.diff
File date_hierarchy_initialisation.2.diff, 958 bytes (added by , 14 years ago) |
---|
-
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( 231 first=models.Min(field_name), last=models.Max(field_name)) 232 if date_range['first'].year == date_range['last'].year: 233 year_lookup = date_range['first'].year 234 if date_range['first'].month == date_range['last'].month: 235 month_lookup = date_range['first'].month 236 228 237 if year_lookup and month_lookup and day_lookup: 229 238 day = datetime.date(int(year_lookup), int(month_lookup), int(day_lookup)) 230 239 return {