PEP8 party 2
This commit is contained in:
1 parent
4b3ffeda3c
commit
1a68e4b95b
3 files changed
+90
-71
No files matched your search
@@ -7,6 +7,7 @@ from models import *
|
||||
|
||||
import utils
|
||||
|
||||
|
||||
class OrderForm(forms.ModelForm):
|
||||
def clean_customer(self):
|
||||
if self.cleaned_data['customer'].get_profile().balance <= 0:
|
||||
@@ -18,16 +19,19 @@ class OrderForm(forms.ModelForm):
|
||||
model = Order
|
||||
fields = ('customer',)
|
||||
|
||||
|
||||
class OrderLineForm(forms.Form):
|
||||
product = forms.IntegerField(required=True)
|
||||
amount = forms.IntegerField(required=True)
|
||||
unit_price = forms.FloatField(required=True, localize=True)
|
||||
|
||||
|
||||
class DepositForm(forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = Transaction
|
||||
|
||||
|
||||
class SimpleCreateUserForm(forms.Form):
|
||||
first_name = forms.CharField(required=True, label="Fornavn")
|
||||
last_name = forms.CharField(required=True, label="Etternavn")
|
||||
@@ -54,6 +58,7 @@ class SimpleCreateUserForm(forms.Form):
|
||||
|
||||
return user
|
||||
|
||||
|
||||
class InventoryTransactionForm(forms.ModelForm):
|
||||
unit_price = forms.FloatField(required=True, localize=True)
|
||||
|
||||
@@ -66,6 +71,7 @@ class InventoryTransactionForm(forms.ModelForm):
|
||||
model = InventoryTransaction
|
||||
fields = ['product', 'amount', 'unit_price', 'comment']
|
||||
|
||||
|
||||
class DateRangeForm(forms.Form):
|
||||
start_time = forms.DateTimeField(required=False, label=_("Fra"))
|
||||
end_time = forms.DateTimeField(required=False, label=_("Til"))
|
||||
|
||||
Reference in new issue
Block a user