2011-10-13 21:34:56 +00:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2011-07-13 09:35:51 +00:00
|
|
|
from django import forms
|
2009-12-24 14:23:52 +00:00
|
|
|
from django.forms.extras import SelectDateWidget
|
2011-07-13 09:35:51 +00:00
|
|
|
|
2011-10-13 21:34:56 +00:00
|
|
|
from .models import Company
|
|
|
|
|
2009-12-24 14:23:52 +00:00
|
|
|
|
|
|
|
class I18nForm(forms.Form):
|
2010-03-27 16:43:27 +00: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 14:23:52 +00:00
|
|
|
|
|
|
|
class SelectDateForm(forms.Form):
|
|
|
|
date_field = forms.DateField(widget=SelectDateWidget)
|
|
|
|
|
2009-12-30 22:11:48 +00:00
|
|
|
class CompanyForm(forms.ModelForm):
|
2010-03-27 16:43:27 +00:00
|
|
|
cents_payed = forms.DecimalField(max_digits=4, decimal_places=2, localize=True)
|
|
|
|
products_delivered = forms.IntegerField(localize=True)
|
2010-05-21 14:07:54 +00:00
|
|
|
date_added = forms.DateTimeField(localize=True)
|
2010-03-27 16:43:27 +00:00
|
|
|
|
2009-12-30 22:11:48 +00:00
|
|
|
class Meta:
|
|
|
|
model = Company
|