byline for week

This commit is contained in:
j 2024-02-06 17:47:54 +01:00
commit 82edae60fb
7 changed files with 60 additions and 2 deletions

View file

@ -42,6 +42,10 @@ def format_week(week):
extra = ''
return '%s - %s%s' % (a, b, extra)
def get_byline(week):
extra = models.Week.objects.filter(monday=week).first()
if extra:
return extra.byline
def get_weeks(archive):
weeks = sorted(set(archive.values_list('year', 'week')))
@ -103,6 +107,7 @@ def archive(request, year=None, month=None, day=None, week=None):
extra = models.Week.objects.filter(monday=context['this_week']).first()
if extra:
context['week_title'] = extra.title
context['week_byline'] = extra.byline
elif week:
week = int(week)
year = int(year)