#15279: Inheritance of rel fields from a single abstract base class through multiple abstract classes causes errors. --------------------------------------------------------+------------------- Reporter: melinath | Owner: melinath Status: new | Milestone: Component: Database layer (models, ORM) | Version: SVN Resolution: | Keywords: Triage Stage: Accepted | Has patch: 1 Needs documentation: 1 | Needs tests: 1 Patch needs improvement: 1 | --------------------------------------------------------+-------------------
Comment (by melinath): I've added a version of the ticket that should accomplish what I'm trying to do. Unfortunately, it seems to cause some issues... the test suite has a number of exceptions which don't otherwise appear. I will look into it. {{{ #!sh ====================================================================== ERROR: test_more_more_more (regressiontests.aggregation_regress.tests.AggregationTests) ---------------------------------------------------------------------- Traceback (most recent call last): File ".../django/tests/regressiontests/aggregation_regress/tests.py", line 631, in test_more_more_more qs = HardbackBook.objects.annotate(n_authors=Count('authors')).values('name', 'n_authors') File ".../django/django/db/models/manager.py", line 147, in annotate return self.get_query_set().annotate(*args, **kwargs) File ".../django/django/db/models/query.py", line 644, in annotate is_summary=False) File ".../django/django/db/models/sql/query.py", line 965, in add_aggregate field_list, opts, self.get_initial_alias(), False) File ".../django/django/db/models/sql/query.py", line 1236, in setup_joins "Choices are: %s" % (name, ", ".join(names))) FieldError: Cannot resolve keyword 'authors' into field. Choices are: book_ptr, contact, id, isbn, name, pages, price, pubdate, publisher, rating, store, weight ====================================================================== ERROR: test_inherited_fields (regressiontests.model_inheritance_regress.tests.ModelInheritanceTest) ---------------------------------------------------------------------- Traceback (most recent call last): File ".../django/tests/regressiontests/model_inheritance_regress/tests.py", line 253, in test_inherited_fields m2mchildren = list(M2MChild.objects.filter(articles__isnull=False)) File ".../django/django/db/models/manager.py", line 141, in filter return self.get_query_set().filter(*args, **kwargs) File ".../django/django/db/models/query.py", line 550, in filter return self._filter_or_exclude(False, *args, **kwargs) File ".../django/django/db/models/query.py", line 568, in _filter_or_exclude clone.query.add_q(Q(*args, **kwargs)) File ".../django/django/db/models/sql/query.py", line 1170, in add_q can_reuse=used_aliases, force_having=force_having) File ".../django/django/db/models/sql/query.py", line 1058, in add_filter negate=negate, process_extras=process_extras) File ".../django/django/db/models/sql/query.py", line 1236, in setup_joins "Choices are: %s" % (name, ", ".join(names))) FieldError: Cannot resolve keyword 'articles' into field. Choices are: id, m2mbase_ptr, name ====================================================================== ERROR: test_table_exists (modeltests.proxy_model_inheritance.tests.ProxyModelInheritanceTests) ---------------------------------------------------------------------- Traceback (most recent call last): File ".../django/tests/modeltests/proxy_model_inheritance/tests.py", line 25, in setUp call_command('syncdb', verbosity=0) File ".../django/django/core/management/__init__.py", line 166, in call_command return klass.execute(*args, **defaults) File ".../django/django/core/management/base.py", line 220, in execute output = self.handle(*args, **options) File ".../django/django/core/management/base.py", line 351, in handle return self.handle_noargs(**options) File ".../django/django/core/management/commands/syncdb.py", line 121, in handle_noargs custom_sql = custom_sql_for_model(model, self.style, connection) File ".../django/django/core/management/sql.py", line 150, in custom_sql_for_model app_dir = os.path.normpath(os.path.join(os.path.dirname(models.get_app(model._meta.app_label).__file__), 'sql')) File ".../django/django/db/models/loading.py", line 140, in get_app raise ImproperlyConfigured("App with label %s could not be found" % app_label) ImproperlyConfigured: App with label model_inheritance could not be found ====================================================================== ERROR: test_distinct_for_inherited_m2m_in_list_filter (regressiontests.admin_changelist.tests.ChangeListTests) ---------------------------------------------------------------------- Traceback (most recent call last): File ".../django/tests/regressiontests/admin_changelist/tests.py", line 197, in test_distinct_for_inherited_m2m_in_list_filter m.list_editable, m) File ".../django/django/contrib/admin/views/main.py", line 66, in __init__ self.query_set = self.get_query_set() File ".../django/django/contrib/admin/views/main.py", line 193, in get_query_set raise IncorrectLookupParameters IncorrectLookupParameters ====================================================================== FAIL: test_bug_8245 (regressiontests.bug8245.tests.Bug8245Test) ---------------------------------------------------------------------- Traceback (most recent call last): File ".../django/tests/regressiontests/bug8245/tests.py", line 18, in test_bug_8245 'autodiscover should have raised a "Bad admin module" error.') AssertionError: autodiscover should have raised a "Bad admin module" error. ====================================================================== FAIL: test_load_error (regressiontests.templates.tests.TemplateTagLoading) ---------------------------------------------------------------------- Traceback (most recent call last): File ".../django/tests/regressiontests/templates/tests.py", line 1578, in test_load_error self.assertTrue('ImportError' in e.args[0]) AssertionError: False is not True ---------------------------------------------------------------------- }}} -- Ticket URL: <http://code.djangoproject.com/ticket/15279#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 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.