Completed admin views
Corrected model method return values
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
|
||||
from ..models import Dataset
|
||||
from ..modules import db
|
||||
|
||||
from wtforms.validators import ValidationError
|
||||
@ -42,4 +43,14 @@ def get_time_options():
|
||||
('90', '1 hour 30 minutes'),
|
||||
('120', '2 hours')
|
||||
]
|
||||
return time_options
|
||||
return time_options
|
||||
|
||||
def get_dataset_choices():
|
||||
datasets = Dataset.query.all()
|
||||
dataset_choices = []
|
||||
for dataset in datasets:
|
||||
label = dataset['date'].strftime('%Y%m%d%H%M%S')
|
||||
label = f'{label} (Default)' if dataset.default else label
|
||||
choice = (dataset['id'], label)
|
||||
dataset_choices.append(choice)
|
||||
return dataset_choices
|
Reference in New Issue
Block a user