flask_crud_app/config.py

39 lines
974 B
Python

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
}
}