2011-07-13 11:35:51 +02:00
|
|
|
from django import forms
|
|
|
|
|
2011-10-13 23:34:56 +02:00
|
|
|
from .models import Company
|
|
|
|
|
2009-12-24 15:23:52 +01:00
|
|
|
|
|
|
|
class I18nForm(forms.Form):
|
2010-03-27 17:43:27 +01:00
|
|
|
decimal_field = forms.DecimalField(localize=True)
|
|
|
|
float_field = forms.FloatField(localize=True)
|
|
|
|
date_field = forms.DateField(localize=True)
|
|
|
|
datetime_field = forms.DateTimeField(localize=True)
|
|
|
|
time_field = forms.TimeField(localize=True)
|
|
|
|
integer_field = forms.IntegerField(localize=True)
|
2009-12-24 15:23:52 +01:00
|
|
|
|
2013-11-03 05:36:09 +01:00
|
|
|
|
2009-12-24 15:23:52 +01:00
|
|
|
class SelectDateForm(forms.Form):
|
2015-01-26 04:28:57 +01:00
|
|
|
date_field = forms.DateField(widget=forms.SelectDateWidget)
|
2009-12-24 15:23:52 +01:00
|
|
|
|
2013-11-03 05:36:09 +01:00
|
|
|
|
2009-12-30 23:11:48 +01:00
|
|
|
class CompanyForm(forms.ModelForm):
|
2011-12-03 18:34:52 +01:00
|
|
|
cents_paid = forms.DecimalField(max_digits=4, decimal_places=2, localize=True)
|
2010-03-27 17:43:27 +01:00
|
|
|
products_delivered = forms.IntegerField(localize=True)
|
2010-05-21 16:07:54 +02:00
|
|
|
date_added = forms.DateTimeField(localize=True)
|
2010-03-27 17:43:27 +01:00
|
|
|
|
2009-12-30 23:11:48 +01:00
|
|
|
class Meta:
|
|
|
|
model = Company
|
2013-02-21 22:56:55 +01:00
|
|
|
fields = '__all__'
|