Finished admin console

This commit is contained in:
2022-06-15 23:54:44 +01:00
parent 62160beab2
commit 2ea778143e
33 changed files with 198 additions and 206 deletions

View File

@@ -1,5 +1,4 @@
from ..models import Dataset
from ..modules import db
from wtforms.validators import ValidationError
@@ -46,11 +45,12 @@ def get_time_options():
return time_options
def get_dataset_choices():
from ..models import Dataset
datasets = Dataset.query.all()
dataset_choices = []
for dataset in datasets:
label = dataset['date'].strftime('%Y%m%d%H%M%S')
label = dataset.date.strftime('%Y%m%d%H%M%S')
label = f'{label} (Default)' if dataset.default else label
choice = (dataset['id'], label)
choice = (dataset.id, label)
dataset_choices.append(choice)
return dataset_choices