#13015: Language regarding ModelForms with instances attached vs. bound Forms is
unclear
-----------------------------+----------------------------------------------
   Reporter:  Wedg           |                Owner:  nobody    
     Status:  new            |            Milestone:            
  Component:  Documentation  |              Version:  SVN       
   Keywords:                 |                Stage:  Unreviewed
  Has_patch:  0              |           Needs_docs:  0         
Needs_tests:  0              |   Needs_better_patch:  0         
-----------------------------+----------------------------------------------
 I discovered that providing initial via the field =
 FormField(initial='foobar') method and form =
 ModelForm(initial={'field':'method'}) behaves differently when the
 ModelForm is attached to a difference.

 The documentation refers to a model instance bound to a form (at least in
 one location: http://docs.djangoproject.com/en/1.1/topics/forms/modelforms
 /#overriding-the-clean-method).

 And also the documentation describing initial (both for fields and Forms)
 says that it only provides a value for unbound forms.

 Perhaps we could clarify the language to say that an instance is attached
 to a ModelForm, but the form itself is unbound - and maybe yet further
 explain that any initial= values for a FormField will be overridden by the
 values from an attached model instance, which in turn will be overridden
 by any initial= values provided to the ModelForm at runtime.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13015>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to