Thanks a lot! It didn't cross my mind to check the "hidden" relations as this was the first time for me with multi-table inheritance.
-Jori On May 16, 2:26 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Sun, May 16, 2010 at 4:58 AM, Jori <jtla...@gmail.com> wrote: > > The problem seems to be that you have named a field in your Comment model > with the same name, only lower case. Comment inherits from Entry, using > multi-table-inheritance. This adds a OneToOneField in Comment back to Entry, > which has a side-effect of adding a 'comment' attribute to Entry. This is > the attribute that lets you access the Comment associated with the Entry as > a result of the OneToOneField in Comment, and by default it is given the > name of the related model, all-lowercase. > > The problem then occurs when the Comment model "inherits' all the > fields/attributes of Entry: the inherited 'comment' attribute from Entry is > apparently over-riding the specified comment field. That's probably a bug, > but it appears to have been there since 1.0. I have not done any research to > see if it's been reported. > > As a workaround you can name your fields something other than the model name > all lowercased, or you can explicitly specify the OneToOneField in the child > models, specifying parent_link=True and something other than the model name > all lowercased for related_name. > > Karen > --http://tracey.org/kmt/ > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.