Adds working deposit and purchases.
- Switch to bootstrap. - Still no balance checking or form feedback messages.
This commit is contained in:
1 parent
ce8190c870
commit
fc400dffd4
36 files changed
+9233
-812
No files matched your search
+14
-13
@@ -2,17 +2,18 @@ from django import forms
|
||||
|
||||
from models import *
|
||||
|
||||
class OrderForm(forms.Form):
|
||||
pass
|
||||
class OrderForm(forms.ModelForm):
|
||||
# TODO : validate that the customer can afford the order
|
||||
class Meta:
|
||||
model = Order
|
||||
fields = ('customer',)
|
||||
|
||||
class OrderLineForm(forms.ModelForm):
|
||||
#product = forms.CharField(required=True, widget=forms.HiddenInput)
|
||||
#amount = forms.IntegerField(required=True)
|
||||
class Meta:
|
||||
model = OrderLine
|
||||
fields = ('amount','product')
|
||||
widgets = {
|
||||
'product': forms.HiddenInput(),
|
||||
'amount': forms.TextInput(attrs={'size': '2'}),
|
||||
}
|
||||
# TODO : Validation
|
||||
class OrderLineForm(forms.Form):
|
||||
product = forms.IntegerField(required=True)
|
||||
amount = forms.IntegerField(required=True)
|
||||
unit_price = forms.FloatField(required=True)
|
||||
|
||||
class DepositForm(forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = Transaction
|
||||
Reference in new issue
Block a user