Feat: Assessment page completed with save method combining Assessment, Distraction, Assessment Command Modality Link, and Assessment Response save for creating new complete Assessnent.
This commit is contained in:
@@ -79,17 +79,14 @@ class Command_Button_Link(SQLAlchemy_ABC, Base):
|
||||
_m = 'Command_Button_Link.from_json'
|
||||
command_button_link = cls()
|
||||
if json is None: return command_button_link
|
||||
# Helper_App.console_log(f'{_m}\njson: {json}')
|
||||
command_button_link.id_link = json.get(Command_Button_Link.ATTR_ID_COMMAND_BUTTON_LINK, -1)
|
||||
command_button_link.id_command = json[Command.FLAG_COMMAND]
|
||||
command_button_link.id_button_shape = json[Button_Shape.FLAG_BUTTON_SHAPE]
|
||||
command_button_link.id_button_colour = json[Colour.FLAG_COLOUR]
|
||||
command_button_link.id_button_icon = json[Button_Icon.FLAG_BUTTON_ICON]
|
||||
command_button_link.id_location = json[Location.FLAG_LOCATION]
|
||||
command_button_link.active = json[cls.FLAG_ACTIVE]
|
||||
command_button_link.active = av.input_bool(json[cls.FLAG_ACTIVE], cls.FLAG_ACTIVE, _m)
|
||||
command_button_link.created_on = json.get(cls.FLAG_CREATED_ON, None)
|
||||
# command_button_link.id_command_category = json[Command_Category.FLAG_COMMAND_CATEGORY]
|
||||
# Helper_App.console_log(f'Dog Command Link: {command_button_link}')
|
||||
return command_button_link
|
||||
|
||||
def to_json(self):
|
||||
@@ -104,8 +101,6 @@ class Command_Button_Link(SQLAlchemy_ABC, Base):
|
||||
, self.FLAG_ACTIVE: self.active
|
||||
, self.FLAG_CREATED_ON: self.created_on
|
||||
}
|
||||
# , Command_Category.FLAG_COMMAND_CATEGORY: self.id_command_category
|
||||
# Helper_App.console_log(f'as_json: {as_json}')
|
||||
return as_json
|
||||
|
||||
def __repr__(self):
|
||||
@@ -299,8 +294,6 @@ class Parameters_Command_Button_Link(Get_Many_Parameters_Base):
|
||||
@classmethod
|
||||
def from_form_filters_command_button_link(cls, form):
|
||||
_m = f'{cls.__qualname__}.from_form_filters_command_button_link'
|
||||
Helper_App.console_log(_m)
|
||||
Helper_App.console_log(f'Filters: {form}')
|
||||
av.val_instance(form, 'form', _m, Filters_Command_Button_Link)
|
||||
has_filter_search_text = not (form.search.data == '' or form.search.data is None)
|
||||
has_filter_command_category = not (form.id_command_category.data == '0' or form.id_command_category.data == '' or form.id_command_category.data is None)
|
||||
@@ -310,16 +303,7 @@ class Parameters_Command_Button_Link(Get_Many_Parameters_Base):
|
||||
has_filter_button_icon = not (form.id_button_icon.data == '0' or form.id_button_icon.data == '' or form.id_button_icon.data is None)
|
||||
has_filter_location = not (form.id_location.data == '0' or form.id_location.data == '' or form.id_location.data is None)
|
||||
active_only = av.input_bool(form.active_only.data, "active", _m)
|
||||
Helper_App.console_log(f'''
|
||||
has_filter_search_text: {has_filter_search_text}
|
||||
has_filter_command_category: {has_filter_command_category}
|
||||
has_filter_command: {has_filter_command}
|
||||
has_filter_button_shape: {has_filter_button_shape}
|
||||
has_filter_colour: {has_filter_colour}
|
||||
has_filter_button_icon: {has_filter_button_icon}
|
||||
has_filter_location: {has_filter_location}
|
||||
active_only: {active_only}
|
||||
''')
|
||||
|
||||
filters = cls.get_default()
|
||||
filters.get_all_link = True
|
||||
filters.get_inactive_link = not active_only
|
||||
|
||||
Reference in New Issue
Block a user