#8161: ManyToManyField with relation to self not saved in admin when using
inheritance
---------------------------------------------------+------------------------
          Reporter:  Mathijs de Bruin              |         Owner:  nobody     
                                              
            Status:  new                           |     Milestone:             
                                              
         Component:  Database layer (models, ORM)  |       Version:  1.0-alpha  
                                              
        Resolution:                                |      Keywords:  newforms 
newforms-admin admin inheritance manytomany self
             Stage:  Accepted                      |     Has_patch:  0          
                                              
        Needs_docs:  0                             |   Needs_tests:  0          
                                              
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Changes (by [email protected]):

  * component:  Core framework => Database layer (models, ORM)

Comment:

 With the same code piece I just inserted test1 test2 test3 as slug field
 values for ParentModel and testc1 testc2 and testc3 for ChildModel and
 linked testc2 to testc1 and testc3 to testc2

 The bug is not just in the admin, it happens on the interactive
 interpreter too. This is the small piece of test code on the interpreter.

 >>> from dummy.testapp.models import ChildModel, ParentModel
 >>> ChildModel.objects.all()
 [<ChildModel: testc1>, <ChildModel: testc2>, <ChildModel: testc3>]
 >>> ParentModel.objects.all()
 [<ParentModel: test1>, <ParentModel: tes2>, <ParentModel: test3>,
 <ParentModel: testc1>, <ParentModel: testc2>, <ParentModel: testc3>]
 >>> c2 = ChildModel.objects.get(slug='testc2')
 >>> c2.links
 <django.db.models.fields.related.ManyRelatedManager object at 0x99c490c>
 >>> c2.links.all()
 []
 >>> c1 = ChildModel.objects.get(slug='testc1')
 >>> c1.links.all()
 [<ParentModel: testc2>, <ParentModel: testc3>]
 >>> c3 = ChildModel.objects.get(slug='testc3')
 >>> c3.links.all()
 []

 So I suppose this bug is not just in admin Interface but in the ORM
 itself. So I change the component. Can some one help me track this bug and
 fix it? As in how to go about? Where to look for the code?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8161#comment:7>
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