Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
migrations
model_fields
model_forms
model_inheritance_regress
mutually_referential
nested_foreign_keys
null_fk
Expand Down
12 changes: 12 additions & 0 deletions django_mongodb/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions django_mongodb/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down