Re: [Django] #11872: can't pass instance=None to inline formset

2009-10-12 Thread Django
#11872: can't pass instance=None to inline formset
---+
  Reporter:  tobias| Owner:  brosner
Status:  new   | Milestone:  1.2
 Component:  Forms |   Version:  1.1
Resolution:|  Keywords: 
 Stage:  Accepted  | Has_patch:  1  
Needs_docs:  0 |   Needs_tests:  0  
Needs_better_patch:  0 |  
---+
Changes (by brosner):

  * owner:  nobody => brosner
  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
Ticket URL: 
Django 
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
-~--~~~~--~~--~--~---



[Django] #11872: can't pass instance=None to inline formset

2009-09-12 Thread Django
#11872: can't pass instance=None to inline formset
+---
 Reporter:  tobias  |   Owner:  nobody
   Status:  new |   Milestone:  1.2   
Component:  Forms   | Version:  1.1   
 Keywords:  |   Stage:  Unreviewed
Has_patch:  1   |  
+---
 If you try to pass instance=None to a new unbound formset you get an
 exception:

 {{{
 Traceback (most recent call last):
   File "/home/tobias/caktus/eclipse-workspace/django-
 trunk/tests/regressiontests/model_formsets_regress/tests.py", line 152, in
 test_formset_with_none_instance
 form_set = FormSet(instance=None)
   File "../django/forms/models.py", line 721, in __init__
 backlink_value = getattr(self.instance, self.fk.rel.field_name)
 AttributeError: 'UserSite' object has no attribute 'username'
 }}}

 because the formset is trying to instantiate the wrong type of model in
 place of the None instance.

 A quick one-line change fixes the problem.  Attached is a patch with a
 test demonstrating the problem and the proposed solution.

-- 
Ticket URL: 
Django 
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
-~--~~~~--~~--~--~---