From cd4d1bb095bd763324fe9b8ee199ecc416fdab02 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 4 Apr 2023 17:23:50 +0200 Subject: [PATCH] add select field --- ereuse_devicehub/inventory/forms.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index 47b07f91..bbc0ea1b 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -111,6 +111,15 @@ DEVICES = { "Other Devices": ["Other"], } +TYPES_DOCUMENTS = [ + ("", ""), + ("image", "Image"), + ("main_image", "Main Image"), + ("functionality_report", "Functionality Report"), + ("data_sanitization_report", "Data Sanitization Report"), + ("disposition_report", "Disposition Report"), +] + COMPUTERS = ['Desktop', 'Laptop', 'Server', 'Computer'] MONITORS = ["ComputerMonitor", "Monitor", "TelevisionSet", "Projector"] @@ -1352,11 +1361,12 @@ class DeviceDocumentForm(FlaskForm): render_kw={'class': "form-control"}, description="Identification number of document", ) - type = StringField( + type = SelectField( 'Type', [validators.Optional()], - render_kw={'class': "form-control"}, - description="Type of document", + choices=TYPES_DOCUMENTS, + default="", + render_kw={'class': "form-select"}, ) date = DateField( 'Date',