From a7fa52490cee7bdad04cc116680e0875f41c1240 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 22 Sep 2018 08:16:26 +0200 Subject: [PATCH] Create GenericPaymentForm --- hosting/forms.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hosting/forms.py b/hosting/forms.py index 7beab60f..bbfda8b8 100644 --- a/hosting/forms.py +++ b/hosting/forms.py @@ -52,6 +52,21 @@ class HostingUserLoginForm(forms.Form): raise forms.ValidationError(_("User does not exist")) +class GenericPaymentForm(forms.Form): + amount = forms.DecimalField(widget=forms.TextInput(), + max_digits=8, + decimal_places=2, + min_value=1) + recurring = forms.BooleanField() + description = forms.Textarea() + + class Meta: + fields = ['amount', 'recurring', 'description'] + + def clean(self): + return self.cleaned_data + + class HostingUserSignupForm(forms.ModelForm): confirm_password = forms.CharField(label=_("Confirm Password"), widget=forms.PasswordInput())