Feat(SQL, UI): Button Icons page, Command Button Links page created with get and set functionality.
This commit is contained in:
@@ -28,7 +28,7 @@ class Command_Category(SQLAlchemy_ABC, Base):
|
||||
__table_args__ = { 'extend_existing': True }
|
||||
|
||||
id_command_category = db.Column(db.Integer, primary_key=True)
|
||||
code = db.Column(db.String(100))
|
||||
code = db.Column(db.String(250))
|
||||
name = db.Column(db.String(250))
|
||||
active = db.Column(db.Boolean)
|
||||
|
||||
@@ -57,6 +57,15 @@ class Command_Category(SQLAlchemy_ABC, Base):
|
||||
level.name = query_row[4]
|
||||
level.active = True
|
||||
return level
|
||||
|
||||
@classmethod
|
||||
def from_db_command_button_link(cls, query_row):
|
||||
_m = f'{cls.__qualname__}.from_db_command_button_link'
|
||||
level = cls()
|
||||
level.id_command_category = query_row[1]
|
||||
level.name = query_row[2]
|
||||
level.active = True
|
||||
return level
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json):
|
||||
@@ -65,8 +74,8 @@ class Command_Category(SQLAlchemy_ABC, Base):
|
||||
if json is None: return Command_Category
|
||||
# Helper_App.console_log(f'{_m}\njson: {json}')
|
||||
command_category.id_command_category = json.get(cls.ATTR_ID_COMMAND_CATEGORY, -1)
|
||||
command_category.code = json[cls.FLAG_CODE]
|
||||
command_category.name = json[cls.FLAG_NAME]
|
||||
command_category.code = json.get(cls.FLAG_CODE, command_category.name.upper().replace(" ", "_"))
|
||||
command_category.active = json[cls.FLAG_ACTIVE]
|
||||
# Helper_App.console_log(f'Command_Category: {command_category}')
|
||||
return command_category
|
||||
@@ -99,7 +108,7 @@ class Command_Category_Temp(db.Model, Base):
|
||||
__table_args__ = { 'extend_existing': True }
|
||||
id_temp = db.Column(db.Integer, primary_key=True)
|
||||
id_command_category = db.Column(db.Integer)
|
||||
# code = db.Column(db.String(100))
|
||||
# code = db.Column(db.String(250))
|
||||
name = db.Column(db.String(250))
|
||||
active = db.Column(db.Boolean)
|
||||
guid: str = db.Column(db.String(36))
|
||||
|
||||
Reference in New Issue
Block a user