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.
dataset/ETHPy150Open mozilla/kitsune/kitsune/gallery/views.py/_init_media_form