On 29/01/13 12:53, Timmy O'Mahony wrote:
> At the moment, writing custom admin actions
> <https://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/#actions-as-modeladmin-methods>
> requires an old style view function that returns a Response object. The
> signature for this is similar to a old function-based view (except with
> modeladmin before request): 
>     func(modeladmin, request, queryset):
>         ...
>         return HttpResponse()
> I wanted to write an action with an intermediate page
> <https://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/#actions-that-provide-intermediate-pages>,
> but using class based views (for uniformity across my app). This doesn't
> seem to be doable without writing a custom base View object

Changing the signature would be backwards incompatible (or very hacky).

You can always do:

  def my_admin_action(modeladmin, request, queryset):
      return MyView.as_view(request, modeladmin, queryset)

And then take it to the next step:

  my_admin_action = cbv_to_admin_action(MyView)


"I am going to let you move around more, just to break up the
mahogany." (True Quotes From Induhviduals, Scott Adams)

Luke Plant || http://lukeplant.me.uk/

You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to