def formset_view(request):
    if request.method == 'POST':
        formset = TestFormSet(request.POST)
        if formset.is_valid():
            t = Template('Valid POST data.', name='Valid POST Template')
            c = Context()
        else:
            t = Template('Invalid POST data. {{ my_formset.errors }}',
                         name='Invalid POST Template')
            c = Context({'my_formset': formset})
    else:
        formset = TestForm(request.GET)
        t = Template('Viewing base formset. {{ my_formset }}.',
                     name='Formset GET Template')
        c = Context({'my_formset': formset})
    return HttpResponse(t.render(c))
Check if user is a superuser.
dataset/ETHPy150Open django/django/tests/test_client/views.py/formset_view--crossover with--dataset/ETHPy150Open ExCiteS/geokey/geokey/superusertools/base.py/IsSuperuser.has_permission