Files
robotopro/promotions/forms.py
Fergal Moran 294a55889c Initial commit
2013-08-29 12:08:44 +01:00

29 lines
951 B
Python
Executable File

from django.forms import ModelForm, DateInput, CheckboxInput
from django.forms.widgets import TextInput
from promotions.models import Promotion
class PromotionWizardDetailsPage(ModelForm):
error_css_class = 'error'
class Meta:
model = Promotion
fields = ['id', 'description', 'start_date', 'end_date', 'active']
widgets = {
'description': TextInput(attrs={'class': 'span8'}),
'start_date': DateInput(attrs={'class': 'date-picker'}),
'end_date': DateInput(attrs={'class': 'date-picker'}),
'active': CheckboxInput(attrs={'class': 'ace ace-switch ace-switch-5'}),
}
class PromotionWizardLayoutPage(ModelForm):
class Meta:
model = Promotion
fields = ['id', 'description', 'body_text']
widgets = {
'description': TextInput(attrs={'class': 'span8'}),
'body_text': TextInput(attrs={'class': 'span8'}),
}