#13781: select_related and multiple inheritance -------------------------------------+------------------------------------- Reporter: | Owner: nobody shauncutts | Status: reopened Type: Bug | Component: Database layer Milestone: | (models, ORM) Version: 1.2 | Severity: Normal Resolution: | Keywords: Triage Stage: Accepted | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 -------------------------------------+------------------------------------- Changes (by srmerritt):
* cc: srmerritt (added) * easy: => 0 Comment: I am getting a separate error from the same issue (select_related failing to handle multiple inheritance), in v1.2. My traceback looks like this: * /django/db/models/query.py", line 335, in get\n num = len(clone)\n', * /django/db/models/query.py", line 80, in __len__\n self._result_cache = list(self.iterator())\n', * /django/db/models/query.py", line 273, in iterator\n only_load=only_load)\n', * /django/db/models/query.py", line 1279, in get_cached_row\n setattr(rel_obj, rel_field.attname, getattr(obj, rel_field.attname))\n', And my error is of this format: AttributeError: "'Parent2' object has no attribute 'Parent1Attribute'". This section of get_cached_row clearly assumes it is dealing with single inheritance, whereas in my case 'obj' is not an instance of 'rel_model'. -- Ticket URL: <http://code.djangoproject.com/ticket/13781#comment:8> Django <https://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.