'Handle an admin action. This is called if a request is POSTed to the
changelist; it returns an HttpResponse if the action was handled, and
None otherwise.'

def response_action(self, request, files_queryset, folders_queryset):

    try:
        action_index = int(request.POST.get(u'index', 0))
    except ValueError:
        action_index = 0
    data = request.POST.copy()
    data.pop(helpers.ACTION_CHECKBOX_NAME, None)
    data.pop(u'index', None)
    try:
        data.update({u'action': data.getlist(u'action')[action_index]})
    except IndexError:
        pass
    action_form = self.action_form(data, auto_id=None)
    action_form.fields[u'action'].choices = self.get_action_choices(request)
    if action_form.is_valid():
        action = action_form.cleaned_data[u'action']
        select_across = action_form.cleaned_data[u'select_across']
        (func, name, description) = self.get_actions(request)[action]
        selected = request.POST.getlist(helpers.ACTION_CHECKBOX_NAME)
        if ((not selected) and (not select_across)):
            msg = _(u'Items    must    be    selected    in    order    to    perform    actions    on    them.    No    items    have    been    changed.')
            self.message_user(request, msg)
            return None
        if (not select_across):
            selected_files = []
            selected_folders = []
            for pk in selected:
                if (pk[:5] == u'file-'):
                    selected_files.append(pk[5:])
                else:
                    selected_folders.append(pk[7:])
            files_queryset = files_queryset.filter(pk__in=selected_files)
            folders_queryset = folders_queryset.filter(pk__in=selected_folders)
        response = func(self, request, files_queryset, folders_queryset)
        if isinstance(response, HttpResponse):
            return response
        else:
            return HttpResponseRedirect(request.get_full_path())
    else:
        msg = _(u'No    action    selected.')
        self.message_user(request, msg)
        return None
