add flatpages

This commit is contained in:
2021-05-13 16:31:05 +00:00
parent bf41aeca1a
commit 66dc28da88
21 changed files with 237 additions and 20 deletions

View File

@@ -165,11 +165,18 @@ class FetMeetingForm(PostForm):
class PostSearchForm(forms.Form):
year_of_first_post = Post.objects.get_queryset().last().public_date.year
years = range(year_of_first_post, timezone.now().date().year + 1)
year_choices = [('', _('Alle'))] + [(i, i) for i in years]
year_choices = [('', _('Alle'))]
month_choices = [('', _('Alle'))] + list(MONTHS.items())
try:
first_post = Post.objects.get_queryset().last()
if first_post:
year_of_first_post = first_post.public_date.year
years = range(year_of_first_post, timezone.now().date().year + 1)
year_choices += [(i, i) for i in years]
except:
pass
year = forms.ChoiceField(label="Jahr", choices=year_choices, required=False)
month = forms.ChoiceField(label="Monat", choices=month_choices, required=False)