<s> import tempfile <EOL> from django . core . files . storage import FileSystemStorage <EOL> from django . db import models <EOL> from django . forms import ModelForm <EOL> temp_storage_dir = tempfile . mkdtemp ( ) <EOL> temp_storage = FileSystemStorage ( temp_storage_dir ) <EOL> class Photo ( models . Model ) : <EOL> title = models . CharField ( max_length = <NUM_LIT:30> ) <EOL> image = models . FileField ( storage = temp_storage , upload_to = '<STR_LIT>' ) <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( Photo , self ) . __init__ ( * args , ** kwargs ) <EOL> self . _savecount = <NUM_LIT:0> <EOL> def save ( self , force_insert = False , force_update = False ) : <EOL> super ( Photo , self ) . save ( force_insert , force_update ) <EOL> self . _savecount += <NUM_LIT:1> <EOL> class PhotoForm ( ModelForm ) : <EOL> class Meta : <EOL> model = Photo </s>
