def _init_media_form(form_cls, request=None, obj=None, ignore_fields=()):
 post_data = None
 initial = None
 if request:
  initial = {'locale': request.LANGUAGE_CODE}
 file_data = None
 if (request.method == 'POST'):
  file_data = request.FILES
  post_data = request.POST.copy()
  if (obj and ignore_fields):
   for f in ignore_fields:
    post_data[f] = getattr(obj, f)
 return form_cls(post_data, file_data, instance=obj, initial=initial, is_ajax=False)

def _init_media_form ( form_cls , request = None , obj = None , ignore_fields = ( ) ) : post_data = None initial = None if request : initial = { 'locale' : request . LANGUAGE_CODE } file_data = None if ( request . method == 'POST' ) : file_data = request . FILES post_data = request . POST . copy ( ) if ( obj and ignore_fields ) : for f in ignore_fields : post_data [ f ] = getattr ( obj , f ) return form_cls ( post_data , file_data , instance = obj , initial = initial , is_ajax = False )
initializes the media form with an image/video instance and posted data .