<s> from django . forms import ModelForm <EOL> from django import forms <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from zorna . site . models import SiteAlert , SiteRegistration <EOL> from zorna . calendars . models import ZornaCalendarCategory <EOL> class SiteAlertAdminAddForm ( ModelForm ) : <EOL> def __init__ ( self , data = None , ** keyw ) : <EOL> super ( SiteAlertAdminAddForm , self ) . __init__ ( data , ** keyw ) <EOL> split_widget = forms . SplitDateTimeWidget ( ) <EOL> split_widget . widgets [ <NUM_LIT:1> ] . attrs = { '<STR_LIT>' : '<STR_LIT>' } <EOL> self . fields [ "<STR_LIT:start>" ] . widget = split_widget <EOL> self . fields [ "<STR_LIT:end>" ] . widget = split_widget <EOL> class Meta : <EOL> model = SiteAlert <EOL> def clean ( self ) : <EOL> start = self . cleaned_data . get ( "<STR_LIT:start>" ) <EOL> end = self . cleaned_data . get ( "<STR_LIT:end>" ) <EOL> if start > end : <EOL> raise forms . ValidationError ( _ ( <EOL> u'<STR_LIT>' ) ) <EOL> return self . cleaned_data <EOL> class ZornaCalendarCategoryForm ( ModelForm ) : <EOL> class Meta : <EOL> model = ZornaCalendarCategory <EOL> class SiteRegistrationForm ( ModelForm ) : <EOL> class Meta : <EOL> model = SiteRegistration </s>
