Skip to content

Commit e646e2b

Browse files
committed
fix deferral of foreign key fields
1 parent 50782dd commit e646e2b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.github/workflows/test-python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
python3 django_repo/tests/runtests.py --settings mongodb_settings -v 2
7070
basic
7171
empty
72+
defer.tests.DeferTests.test_only_values_does_not_defer
7273
from_db_value
7374
lookup.tests.LookupTests.test_escaping
7475
model_fields

django_mongodb/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def delete(self):
129129
def get_cursor(self):
130130
if self.query.low_mark == self.query.high_mark:
131131
return []
132-
fields = [col.field.name for col in self.columns] if self.columns else None
132+
fields = [col.target.column for col in self.columns] if self.columns else None
133133
cursor = self.collection.find(self.mongo_query, fields)
134134
if self.ordering:
135135
cursor.sort(self.ordering)

0 commit comments

Comments
 (0)