Opened 16 years ago

Closed 14 years ago

#6856 closed (invalid)

Better ModelForm examples

Reported by: James Bennett Owned by: James Bennett
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 examples in docs/modelforms.txt show instantiation of a form, then jump straight to saving without calling is_valid(). Several times now I've seen people assume that this means is_valid() isn't needed or present on a ModelForm, usually leading to attempts to save unvalidated data. The examples should be fleshed out a bit more to make this clear.

Change History (3)

comment:1 by Simon Greenhill, 16 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Simon Greenhill, 16 years ago

Also see #6855 for a related issue.

comment:3 by Daniel Roseman, 14 years ago

Resolution: invalid
Status: newclosed

The behaviour changed with model validation, and it is now correctly documented that attempting to save an invalid ModelForm will raise a ValueError.

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