2011-07-13 17:35:51 +08:00
|
|
|
from django import forms
|
|
|
|
|
2011-10-14 05:34:56 +08:00
|
|
|
from .models import Company
|
|
|
|
|
2009-12-24 22:23:52 +08:00
|
|
|
|
|
|
|
class I18nForm(forms.Form):
|
2010-03-28 00:43:27 +08: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 22:23:52 +08:00
|
|
|
|
2013-11-03 12:36:09 +08:00
|
|
|
|
2009-12-24 22:23:52 +08:00
|
|
|
class SelectDateForm(forms.Form):
|
2015-01-26 11:28:57 +08:00
|
|
|
date_field = forms.DateField(widget=forms.SelectDateWidget)
|
2009-12-24 22:23:52 +08:00
|
|
|
|
2013-11-03 12:36:09 +08:00
|
|
|
|
2009-12-31 06:11:48 +08:00
|
|
|
class CompanyForm(forms.ModelForm):
|
2011-12-04 01:34:52 +08:00
|
|
|
cents_paid = forms.DecimalField(max_digits=4, decimal_places=2, localize=True)
|
2010-03-28 00:43:27 +08:00
|
|
|
products_delivered = forms.IntegerField(localize=True)
|
2010-05-21 22:07:54 +08:00
|
|
|
date_added = forms.DateTimeField(localize=True)
|
2010-03-28 00:43:27 +08:00
|
|
|
|
2009-12-31 06:11:48 +08:00
|
|
|
class Meta:
|
|
|
|
model = Company
|
2013-02-22 05:56:55 +08:00
|
|
|
fields = "__all__"
|