From 9a4650626f99141eaa64ce44bdcdf985bb2ec38f Mon Sep 17 00:00:00 2001 From: candifloss Date: Mon, 17 Mar 2025 10:35:58 +0530 Subject: [PATCH] remove: Temporarily remove "compareto" feature - Input validation is tricky for this feature. - This is postponed until a future release. --- definitions/attributes/Attribute.py | 3 +-- definitions/models.py | 2 +- functions/validate_config.py | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/definitions/attributes/Attribute.py b/definitions/attributes/Attribute.py index 1acc787..c39a5af 100644 --- a/definitions/attributes/Attribute.py +++ b/definitions/attributes/Attribute.py @@ -19,8 +19,7 @@ class Attribute: unique: bool = False primary: bool = False default_val: Optional[str] = None - compareto: Optional[List[Tuple[str, str]]] = None - #valid_comparisons: Optional[Set[str]] = None + compareto: Optional[List[Tuple[str, str]]] = None # Work in progress def validate(self) -> Optional[str]: """Validate common attributes. Returns an error message if invalid, otherwise None.""" diff --git a/definitions/models.py b/definitions/models.py index 410b15e..efbe1d7 100644 --- a/definitions/models.py +++ b/definitions/models.py @@ -10,7 +10,7 @@ db = SQLAlchemy() # Users table class User(db.Model): """User model for authentication.""" - __tablename__ = "users_test" + __tablename__ = "users" id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(50), unique=True, nullable=False) diff --git a/functions/validate_config.py b/functions/validate_config.py index a126247..54c324f 100644 --- a/functions/validate_config.py +++ b/functions/validate_config.py @@ -27,6 +27,8 @@ def validate_config(item_attributes: List[Attribute]) -> str: # Validate comparison (if applicable) if attrib.compareto: + return f"'{attrib.attrib_name}': 'compareto' feature is not fully implemented in this release." + ''' WIP if not isinstance(attrib.compareto, list) or not all( isinstance(pair, tuple) and len(pair) == 2 for pair in attrib.compareto ): @@ -39,5 +41,6 @@ def validate_config(item_attributes: List[Attribute]) -> str: ref_attr = attrib_map[ref_attr_name] if ref_attr.html_input_type != attrib.html_input_type: return f"Invalid comparison of '{attrib.attrib_name}' & '{ref_attr_name}' - must be of the same type, {attrib.html_input_type}." + ''' return "Ok" \ No newline at end of file