<s> from datetime import datetime <EOL> from django import forms <EOL> from django . utils . translation import ugettext_lazy as _ <EOL> from photos . models import Image <EOL> class PhotoUploadForm ( forms . ModelForm ) : <EOL> class Meta : <EOL> model = Image <EOL> exclude = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> def clean_image ( self ) : <EOL> if "<STR_LIT:#>" in self . cleaned_data [ "<STR_LIT:image>" ] . name : <EOL> raise forms . ValidationError ( <EOL> _ ( "<STR_LIT>" ) ) <EOL> return self . cleaned_data [ "<STR_LIT:image>" ] <EOL> def __init__ ( self , user = None , * args , ** kwargs ) : <EOL> self . user = user <EOL> super ( PhotoUploadForm , self ) . __init__ ( * args , ** kwargs ) <EOL> class PhotoEditForm ( forms . ModelForm ) : <EOL> class Meta : <EOL> model = Image <EOL> exclude = [ <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT:image>" , <EOL> ] <EOL> def __init__ ( self , user = None , * args , ** kwargs ) : <EOL> self . user = user <EOL> super ( PhotoEditForm , self ) . __init__ ( * args , ** kwargs ) </s>
