Opened 13 years ago

Closed 13 years ago

#16589 closed Bug (worksforme)

ModelForm documentation error (saving unbound form)

Reported by: toby@… Owned by: nobody
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The ModelForm documentation has the following snippet:

# Create a form to edit an existing Article. 
>>> a = Article.objects.get(pk=1) 
>>> f = ArticleForm(instance=a) 
>>> f.save() 

Since the form is unbound, that f.save() is going to fail. Maybe that should be:

print f

Change History (2)

comment:1 by Aymeric Augustin, 13 years ago

Since ArticleForm receives an instance argument, it is bound, isn't it? Did I miss something obvious?

comment:2 by Aymeric Augustin, 13 years ago

Resolution: worksforme
Status: newclosed

No reply => closing the ticket.

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