Feat(SQL, UI): 1. Perfected architecture for modular Search functionality across heirarchical Get Many and Calc Stored Procedures that allows text search filtering on different fields as well as by record Id with control over how the filters are applied. \n 2. Updated User Calc and Get Many Stored Procedures with new Search functionality. \n 3. Improved styles on Dog Command Link page.

This commit is contained in:
2025-07-05 23:17:07 +01:00
parent 0d1e644e6c
commit 8cb8508dcd
51 changed files with 4161 additions and 1292 deletions

View File

@@ -13,6 +13,7 @@ Defines Flask-WTF form for handling user input on Contact Us page.
# IMPORTS
# internal
from dog_training.business_objects.base import Base
from dog_training.business_objects.dog.command_category import Command_Category
from dog_training.business_objects.dog.command import Command
from dog_training.business_objects.dog.dog import Dog
from dog_training.business_objects.dog.obedience_level import Obedience_Level
@@ -40,6 +41,11 @@ class Filters_Dog_Command_Link(Form_Base):
, choices = [Form_Base.get_select_option_all()]
, default = Form_Base.get_select_option_default_value()
)
id_command_category = SelectField(
'Command Category'
, choices = [Form_Base.get_select_option_all()]
, default = Form_Base.get_select_option_default_value()
)
id_command = SelectField(
'Command'
, choices = [Form_Base.get_select_option_all()]
@@ -55,19 +61,21 @@ class Filters_Dog_Command_Link(Form_Base):
_m = f'{cls.__qualname__}.from_json'
Helper_App.console_log(f'{_m}\njson: {json}')
filters = cls()
filters.search.data = json[Base.FLAG_SEARCH_TEXT]
filters.search.data = json[Base.FLAG_SEARCH]
# filters.id_dog.choices = [(json[Dog.ATTR_ID_DOG], json[Dog.ATTR_ID_DOG])]
filters.id_dog.data = json[Dog.ATTR_ID_DOG]
# filters.id_command_category.choices = [(json[Command.ATTR_ID_COMMAND], json[Command.ATTR_ID_COMMAND])]
filters.id_command_category.data = json[Command_Category.ATTR_ID_COMMAND_CATEGORY]
# filters.id_command.choices = [(json[Command.ATTR_ID_COMMAND], json[Command.ATTR_ID_COMMAND])]
filters.id_command.data = json[Command.ATTR_ID_COMMAND]
filters.active_only.data = av.input_bool(json[Base.FLAG_ACTIVE_ONLY], Base.FLAG_ACTIVE_ONLY, f'{cls.__name__}.from_json')
# Helper_App.console_log(f'Command: {command}')
return filters
def to_json(self):
return {
Base.FLAG_SEARCH_TEXT: self.search.data
, Dog.FLAG_DOG: self.id_dog.data
, Command.FLAG_COMMAND: self.id_command.data
Base.FLAG_SEARCH: self.search.data
, Dog.ATTR_ID_DOG: self.id_dog.data
, Command_Category.ATTR_ID_COMMAND_CATEGORY: self.id_command_category.data
, Command.ATTR_ID_COMMAND: self.id_command.data
, Base.FLAG_ACTIVE_ONLY: self.active_only.data
}