#10845: The use of "Instance" in "Creating Forms from Models" is confusing.
---------------------------+------------------------------------------------
 Reporter:  ElfSternberg   |       Owner:  nobody    
   Status:  new            |   Milestone:  1.0.3     
Component:  Documentation  |     Version:  1.0       
 Keywords:  grammar        |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 In the section "Using a subset of fields on a form," the example contains
 the text:

 `instance = Instance(required_field='value')`[[BR]]
 `form = InstanceForm(request.POST, instance=instance)`

 The use of "instance" here as the lvalue of Instance is a poor choice.
 For someone skimming through the article looking just for the syntax for a
 subset of fields on a form, and who may have missed the text earlier in
 the article about the instance keyword, this seems to imply that the
 keyword argument might be some lowercase variant of the Model name.  I
 strongly suggest an alternative example:

 `example = Example(required_field='value')`[[BR]]
 `form = ExampleForm(request.POST, instance=example)`

 Which would make it much more clear that "instance" is the kwarg, and the
 kwarg is not generated dynamically.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/10845>
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-updates@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