2009-12-24 22:23:52 +08:00
|
|
|
from django import template, forms
|
|
|
|
from django.forms.extras import SelectDateWidget
|
2009-12-31 06:11:48 +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
|
|
|
|
|
|
|
class SelectDateForm(forms.Form):
|
|
|
|
date_field = forms.DateField(widget=SelectDateWidget)
|
|
|
|
|
2009-12-31 06:11:48 +08:00
|
|
|
class CompanyForm(forms.ModelForm):
|
2010-03-28 00:43:27 +08:00
|
|
|
cents_payed = forms.DecimalField(max_digits=4, decimal_places=2, localize=True)
|
|
|
|
products_delivered = forms.IntegerField(localize=True)
|
|
|
|
|
2009-12-31 06:11:48 +08:00
|
|
|
class Meta:
|
|
|
|
model = Company
|