same, the only difference being the HTML template they are rendered to,
which .do_GET selects from their method name.
"""
- start = self._params.get_str('start')
- end = self._params.get_str('end')
- if not end:
- end = date_in_n_days(366)
- ret = Day.by_date_range_with_limits(self.conn, (start, end), 'id')
- days, start, end = ret
+ start, end = self._params.get_str('start'), self._params.get_str('end')
+ end = end if end else date_in_n_days(366)
+ days, start, end = Day.by_date_range_with_limits(self.conn,
+ (start, end), 'id')
days = Day.with_filled_gaps(days, start, end)
today = date_in_n_days(0)
return {'start': start, 'end': end, 'days': days, 'today': today}
self.assertEqual(days_result, days_expected)
# for provided Days we use those from days_with_comment, to identify
- # them against mere filler days by their lack of comment (identity
- # with Day at the respective position in days_sans_comment)
+ # them against same-dated mere filler Days by their lack of comment
+ # (identity with Day at the respective position in days_sans_comment)
dates = [f'2024-02-0{n+1}' for n in range(9)]
days_with_comment = [Day(date, comment=date[-1:]) for date in dates]
days_sans_comment = [Day(date, comment='') for date in dates]
tomorrow = datetime.now() + timedelta(days=+1)
self.assertEqual(start, yesterday.strftime(DATE_FORMAT))
self.assertEqual(end, tomorrow.strftime(DATE_FORMAT))
- # make dated items for non-empty results
+ # prepare dated items for non-empty results
kwargs_with_date = self.default_init_kwargs.copy()
if set_id_field:
kwargs_with_date['id_'] = None