@transaction.atomic
def import_pages_from_json(modeladmin, request, queryset,
        template_name='admin/pages/page/import_pages.html'):

    try:
        j = request.FILES['json']
    except __HOLE__:
        return render(request, template_name, {
            'nofile': True,
            'app_label': 'pages',
            'opts': Page._meta,
        }, RequestContext(request))

    errors, pages_created = json_to_pages(j.read(), request.user,
        get_language_from_request(request))

    return render(request, template_name, {
        'errors': errors,
        'pages_created': pages_created,
        'app_label': 'pages',
        'opts': Page._meta,
    }, RequestContext(request))
dataset/ETHPy150Open batiste/django-page-cms/pages/plugins/jsonexport/actions.py/import_pages_from_json