year range in settings file

This commit is contained in:
crunk 2024-04-22 20:59:26 +02:00
parent f5632ccfd2
commit e824430d95
2 changed files with 13 additions and 12 deletions

View File

@ -23,6 +23,17 @@ class UploadForm(FlaskForm):
categories.append((config_category, config_category))
return categories
def year_choices():
APP = settings()
start_time = APP.config["start_time"]
end_time = APP.config["end_time"]
year_range = range(start_time.year, end_time.year, 1)
year_choices = []
for year in year_range:
year_choices.append((str(year), str(year)))
return year_choices
sitename = StringField(
"Name of your archive section:",
validators=[
@ -35,17 +46,7 @@ class UploadForm(FlaskForm):
"Year:",
validate_choice=True,
coerce=str,
choices=[
("2017", "2017"),
("2018", "2018"),
("2019", "2019"),
("2020", "2020"),
("2021", "2021"),
("2022", "2022"),
("2023", "2023"),
("2024", "2024"),
("2025", "2025"),
],
choices=year_choices,
option_widget=None,
validators=[DataRequired()],
)

View File

@ -1,4 +1,4 @@
title = "Varia Archive X Distribusi-Verse"
categories = ["event","gathering","work session","workgroup","performance","music event"]
start_time = 2017-11-03
end_time = 2024-12-31
end_time = 2025-12-31