Browse Source

year range in settings file

main
crunk 5 months ago
parent
commit
e824430d95
  1. 23
      verse/forms/uploadform.py
  2. 2
      verse/settings.toml

23
verse/forms/uploadform.py

@ -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()],
)

2
verse/settings.toml

@ -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

Loading…
Cancel
Save