Opened 12 years ago

Closed 12 years ago

#3079 closed enhancement (worksforme)

[patch] allow to disable POST handling in create_update generic views

Reported by: Bastian Kleineidam <calvin@…> Owned by: Jacob
Component: Generic views Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Suppose you have custom templates for the create_update generic views with more than one form. Then one needs to ensable the POST processing of the generic views only for one single form, and disable it for all the others (supposing of course the form actions all lead to the same view handler function).

This patch adds an additional keyword parameter handle_post=True, which if set to False prevents the object deletion/creation/edit even if the request method is a POST.

The patch is backwards compatible because the default value is True.

Attachments (1)

django_handle_post_arg.diff (2.4 KB) - added by Bastian Kleineidam <calvin@…> 12 years ago.
add handle_post keyword arg

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by Bastian Kleineidam <calvin@…>

Attachment: django_handle_post_arg.diff added

add handle_post keyword arg

comment:1 Changed 12 years ago by James Bennett

Couldn't the same effect be achieved more easily with a wrapper view?

comment:2 Changed 12 years ago by Simon G. <dev@…>

Resolution: worksforme
Status: newclosed

worksforme given Ubernostrum's comment above. Do feel free to convince us otherwise though :)

Note: See TracTickets for help on using tickets.
Back to Top