From d3fca173ac9ee91ff9cbf87ddfec4241cd721e41 Mon Sep 17 00:00:00 2001 From: Reena Aheer Date: Fri, 5 May 2023 12:11:03 +0200 Subject: [PATCH 1/2] Improvement in ATM Attribute --- apimanager/atms/forms.py | 37 ++++++++-------------- apimanager/atms/templates/atms/update.html | 12 +++---- 2 files changed, 19 insertions(+), 30 deletions(-) diff --git a/apimanager/atms/forms.py b/apimanager/atms/forms.py index 545ab9ad..c1ae4bc3 100644 --- a/apimanager/atms/forms.py +++ b/apimanager/atms/forms.py @@ -10,6 +10,14 @@ class CreateAtmForm(forms.Form): + ATTRIBUTE_TYPE = ( + ('', _('Any')), + ('STRING', 'STRING'), + ('INTEGER', 'INTEGER'), + ('DOUBLE', 'DOUBLE'), + ('DATE_WITH_DAY', 'DATE_WITH_DAY'), + ) + atm_id = forms.CharField( label=_('ATM Id'), widget=forms.TextInput( @@ -263,36 +271,17 @@ class CreateAtmForm(forms.Form): ), required=False, ) - type_attribute = forms.CharField( + type_attribute = forms.ChoiceField( label=_('Type'), - widget=forms.TextInput( - attrs={ - 'placeholder': _('Type'), - 'class': 'form-control', - } - ), - required=False, - ) - name_attribute = forms.CharField( - label=_('Attribute Name'), - widget=forms.TextInput( + choices=ATTRIBUTE_TYPE, + widget=forms.Select( attrs={ - 'placeholder': _('Name'), - 'class': 'form-control', + 'class': 'form-control bank_attribute_type', } ), required=False, ) - value_attribute = forms.CharField( - label=_('Value'), - widget=forms.TextInput( - attrs={ - 'placeholder': _('2012-04-23'), - 'class': 'form-control', - } - ), - required=False, - ) + location_categories = forms.CharField( label=_('Location Category'), widget=forms.TextInput( diff --git a/apimanager/atms/templates/atms/update.html b/apimanager/atms/templates/atms/update.html index 6278fd3f..661c4f5e 100644 --- a/apimanager/atms/templates/atms/update.html +++ b/apimanager/atms/templates/atms/update.html @@ -219,30 +219,30 @@

{{ bank_id }} : {{ atm_id }}

ATM Attributes

-
+
-
+
-
+
- +
- + {{ form.type_attribute }}
- +
From 1ed7ba5612ffe5ced78e12d9bd8a74998e4fadd3 Mon Sep 17 00:00:00 2001 From: Reena Aheer Date: Mon, 8 May 2023 11:09:17 +0200 Subject: [PATCH 2/2] Improvement in ATM Attribute --- apimanager/atms/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apimanager/atms/forms.py b/apimanager/atms/forms.py index c1ae4bc3..4750332a 100644 --- a/apimanager/atms/forms.py +++ b/apimanager/atms/forms.py @@ -276,7 +276,7 @@ class CreateAtmForm(forms.Form): choices=ATTRIBUTE_TYPE, widget=forms.Select( attrs={ - 'class': 'form-control bank_attribute_type', + 'class': 'form-control atm_attribute_type', } ), required=False,