Skip to content

Commit

Permalink
fix deferral of foreign key fields
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Apr 29, 2024
1 parent 2b15814 commit 4d2e558
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
run: >
python3 django_repo/tests/runtests.py --settings mongodb_settings -v 2
basic
defer.tests.DeferTests.test_only_values_does_not_defer
from_db_value
lookup.tests.LookupTests.test_escaping
model_fields
Expand Down
3 changes: 2 additions & 1 deletion django_mongodb/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ def delete(self):
def get_cursor(self):
if self.query.low_mark == self.query.high_mark:
return []
fields = [col.field.name for col in self.columns] if self.columns else None

fields = [col.target.column for col in self.columns] if self.columns else None
cursor = self.collection.find(self.mongo_query, fields)
if self.ordering:
cursor.sort(self.ordering)
Expand Down

0 comments on commit 4d2e558

Please sign in to comment.