#9006: QuerySet indexing by __getitem__ gets wrong answer in edge cases
-------------------------------------+--------------------------------------
          Reporter:  smoluf          |         Owner:  nobody             
            Status:  new             |     Milestone:                     
         Component:  Core framework  |       Version:  1.0                
        Resolution:                  |      Keywords:  queryset index race
             Stage:  Unreviewed      |     Has_patch:  0                  
        Needs_docs:  0               |   Needs_tests:  0                  
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Comment (by drozzy):

 I have the same problem.
 When the __getitem__ is called with index 0 on a queryset like:
 [<A: blah, bluh, booh>, <B: blah, bleh, booh>]

 it actually returns <B> always, which is index of 1.

 This only happens when saving objects through inlinemodel formsets.
 Ordering id as pointed out above fixes the problem.
 Strangely enough this does not happen to the model which only has 3
 attributes. The model that breaks in my case has 6 attributes.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9006#comment:3>
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to