Opened 10 years ago

Closed 8 years ago

#6856 closed (invalid)

Better ModelForm examples

Reported by: James Bennett Owned by: James Bennett
Component: Documentation Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


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 Changed 10 years ago by Simon Greenhill

Triage Stage: UnreviewedAccepted

comment:2 Changed 10 years ago by Simon Greenhill

Also see #6855 for a related issue.

comment:3 Changed 8 years ago by Daniel Roseman

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