Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#15657 closed (fixed)

Missing `form` argument in FormMixin documentation

Reported by: Jannis Vajen Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The documentations of FormMixin and ModelFormMixin seem to miss the form argument that is required to execute both methods form_valid() and form_invalid().

class FormMixin:
[…]
def form_valid(self, form):
    return HttpResponseRedirect(self.get_success_url())
	
def form_invalid(self, form):
    return self.render_to_response(self.get_context_data(form=form))
.. method:: form_valid()

     Redirects to :meth:`.get_success_url`.

.. method:: form_invalid()

     Renders a response, providing the invalid form as context.

Change History (3)

comment:1 by Gabriel Hurley, 13 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Gabriel Hurley, 13 years ago

Resolution: fixed
Status: newclosed

In [15895]:

Fixed #15657 -- added the required form parameter to the method signatures of form_valid and form_invalid in the FormMixin docs. Thanks to jnns for the report.

comment:3 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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