summaryrefslogtreecommitdiffstats
path: root/restaurant_orders/settings/forms.py
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2023-07-17 01:47:57 +0200
committerjdlugosz963 <jdlugosz963@gmail.com>2023-07-17 01:52:26 +0200
commitc21f4b3dacd597a15a5ec39d525df1dfe1b70376 (patch)
tree0dfc51d2ffeb7b5022d9ad852f2fd3620c72196a /restaurant_orders/settings/forms.py
parent2c6f98aeef4fa1aba5678fe17c8e762a11db7b40 (diff)
downloadrestaurant-orders-main.tar.gz
restaurant-orders-main.zip
Add project.main
Diffstat (limited to 'restaurant_orders/settings/forms.py')
-rw-r--r--restaurant_orders/settings/forms.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/restaurant_orders/settings/forms.py b/restaurant_orders/settings/forms.py
new file mode 100644
index 0000000..1ea90e9
--- /dev/null
+++ b/restaurant_orders/settings/forms.py
@@ -0,0 +1,18 @@
1from django import forms
2from core.models import Restaurant
3
4FORM_TAILWIND_CLASSES = 'form-control block w-full px-3 py-1.5 text-base font-normal text-gray-700 bg-white bg-clip-padding border border-solid border-gray-300 rounded transition ease-in-out m-0 focus:text-gray-700 focus:bg-white focus:border-blue-600 focus:outline-none'
5
6class RestaurantForm(forms.ModelForm):
7 woocommerce_consumer_key = forms.CharField(required=False)
8 woocommerce_consumer_secret = forms.CharField(required=False)
9 woocommerce_webhook_secret = forms.CharField(required=False)
10
11 class Meta:
12 model = Restaurant
13 exclude = ('users', )
14
15 def __init__(self, *args, **kwargs):
16 super(RestaurantForm, self).__init__(*args, **kwargs)
17 for key in self.fields.keys():
18 self.fields[key].widget.attrs.update({'class': FORM_TAILWIND_CLASSES})