From 845bbf90f849dae097914d082a30f3710728668a Mon Sep 17 00:00:00 2001 From: Antoine Goutenoir Date: Sat, 2 Nov 2019 06:05:24 +0100 Subject: [PATCH] Activate the `selected` keyword in model config. --- flaskr/forms.py | 3 +-- flaskr/laws/travel_emission_linear_fit.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flaskr/forms.py b/flaskr/forms.py index 5a217ee..b64446d 100644 --- a/flaskr/forms.py +++ b/flaskr/forms.py @@ -134,8 +134,7 @@ for model in models: BooleanField( label=model.name, # description=model.short_description, - default=True, - # default=model.default, # todo: from config + default=model.selected, validators=[ validators.Optional(), ], diff --git a/flaskr/laws/travel_emission_linear_fit.py b/flaskr/laws/travel_emission_linear_fit.py index 9ecfda6..aecad9c 100644 --- a/flaskr/laws/travel_emission_linear_fit.py +++ b/flaskr/laws/travel_emission_linear_fit.py @@ -8,6 +8,7 @@ class BaseEmissionModel(): self.name = config.name self.slug = config.slug self.color = config.color + self.selected = config.selected self.config = config.config def __repr__(self): # Cast to String -- libgit2 0.21.2