ModelForm save() cleans data first?

3 views
Skip to first unread message

Continuation

unread,
Dec 1, 2009, 9:14:47 PM12/1/09
to Django users
When a ModelForm object calls save(), does it first clean the form
data using form.cleaned_data? Or do I need to call form.cleaned_data
explicitly?

Skylar Saveland

unread,
Dec 1, 2009, 11:47:28 PM12/1/09
to Django users
Former

Skylar Saveland

unread,
Dec 1, 2009, 11:54:15 PM12/1/09
to Django users
Wait, this is a better question than I thought on first glance. Not
entirely sure, sorry for the terse first response.

Jani Tiainen

unread,
Dec 2, 2009, 2:16:23 AM12/2/09
to django...@googlegroups.com
Saving checks form.errors which (as being property) in turn causes call
to form.full_clean() to generate internal error structure.

So answer is yes, it cleans data if it hasn't been cleaned before
calling save.

--

Jani Tiainen


Reply all
Reply to author
Forward
0 new messages