Changes between Version 10 and Version 11 of Ticket #29724, comment 9
- Timestamp:
- Sep 4, 2019, 5:43:55 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29724, comment 9
v10 v11 9 9 def link (filters): 10 10 {{{ 11 elif year_lookup and month_lookup:12 11 month_filter=field_name+'__month' 13 12 year_filter=field_name+'__year' 14 13 dates_or_datetimes = cl.model.objects.filter(**{year_filter:year_lookup, month_filter:month_lookup}).values_list(field_name, flat=True) 15 days = dates_or_datetimes 16 if isinstance(dates_or_datetimes[0], datetime.datetime) and settings.USE_TZ: 17 days = [] 14 days = [] 15 if dates_or_datetimes.count()>0 and isinstance(dates_or_datetimes.first(), datetime.datetime) and settings.USE_TZ: 18 16 for day in dates_or_datetimes: 19 if make_naive(day).date() not in days: days.append(make_naive(day).date()) 20 17 if make_naive(day).date() not in days: 18 days.append(make_naive(day).date()) 19 else: 20 for day in dates_or_datetimes: 21 if day not in days: days.append(day) 21 22 }}} 22 23