From 7aeee8da476013461db0c4cacccaffab50b5e184 Mon Sep 17 00:00:00 2001 From: candifloss Date: Wed, 5 Feb 2025 16:08:12 +0530 Subject: [PATCH] Drafted config format concept --- config.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 config.py diff --git a/config.py b/config.py new file mode 100644 index 0000000..53c5e16 --- /dev/null +++ b/config.py @@ -0,0 +1,39 @@ +tableitems = { + "assettag": { + "display_name": "Asset Tag", + "html_input_type": "text", + "required": True, + "unique": True, + "primary_key": True, + "regex": r"^[A-Z0-9]+$", + } + "hostname": { + "display_name": "Host Name", + "html_input_type": "text", + "required": True, + "unique": True, + "regex": r"^[a-z0-9._-]+$" # + }, + "warrantyfrom": { + "display_name": "Warranty From", + "html_input_type": "date", + "required": True, + regex: r"^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$" # Date in YYYY-MM-DD + }, + "status": { + "display_name": "Status", + "html_input_type": "select", + required: True, + options: [ + "active": "Active", + "inactive": "Inactive" + ] + }, + "staffnum": { + "display_name": "Staff No.", + "html_input_type": "number", + "required": True, + "min": 100000, # 6 digits + "max": 99999999 # 8 digits + } +} \ No newline at end of file