diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index e412cae32..24a9829a0 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -91,6 +91,7 @@ jobs: migrations model_fields model_forms + model_inheritance_regress mutually_referential nested_foreign_keys null_fk diff --git a/django_mongodb/compiler.py b/django_mongodb/compiler.py index d65ae608e..c18754279 100644 --- a/django_mongodb/compiler.py +++ b/django_mongodb/compiler.py @@ -673,6 +673,10 @@ def insert(self, docs, returning_fields=None): inserted_ids = self.collection.insert_many(docs).inserted_ids return inserted_ids if returning_fields else [] + @cached_property + def collection_name(self): + return self.query.get_meta().db_table + class SQLDeleteCompiler(compiler.SQLDeleteCompiler, SQLCompiler): def execute_sql(self, result_type=MULTI): @@ -690,6 +694,10 @@ def check_query(self): def get_where(self): return self.query.where + @cached_property + def collection_name(self): + return self.query.base_table + class SQLUpdateCompiler(compiler.SQLUpdateCompiler, SQLCompiler): def execute_sql(self, result_type): @@ -754,6 +762,10 @@ def check_query(self): def get_where(self): return self.query.where + @cached_property + def collection_name(self): + return self.query.base_table + class SQLAggregateCompiler(SQLCompiler): def build_query(self, columns=None): diff --git a/django_mongodb/features.py b/django_mongodb/features.py index 8b0707434..06b3dbfc6 100644 --- a/django_mongodb/features.py +++ b/django_mongodb/features.py @@ -266,6 +266,7 @@ def django_test_expected_failures(self): "datetimes.tests.DateTimesTests.test_datetimes_has_lazy_iterator", "datetimes.tests.DateTimesTests.test_datetimes_returns_available_dates_for_given_scope_and_given_field", "datetimes.tests.DateTimesTests.test_related_model_traverse", + "model_inheritance_regress.tests.ModelInheritanceTest.test_issue_7105", "queries.tests.Queries1Tests.test_ticket7155", "queries.tests.Queries1Tests.test_tickets_7087_12242", "timezones.tests.LegacyDatabaseTests.test_query_datetimes",