Opened 18 years ago

Closed 18 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

Description

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@…> 18 years ago.
add handle_post keyword arg

Download all attachments as: .zip

Change History (3)

by Bastian Kleineidam <calvin@…>, 18 years ago

Attachment: django_handle_post_arg.diff added

add handle_post keyword arg

comment:1 by James Bennett, 18 years ago

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

comment:2 by Simon G. <dev@…>, 18 years ago

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