Opened 8 years ago

Closed 5 years ago

#6856 closed (invalid)

Better ModelForm examples

Reported by: ubernostrum Owned by: ubernostrum
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 7 years ago by Simon Greenhill

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 years ago by Simon Greenhill

Also see #6855 for a related issue.

comment:3 Changed 5 years ago by danielr

  • Resolution set to invalid
  • Status changed from new to closed

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