Skip to content

Commit 3063064

Browse files
committed
Add extra comment why deferred fields are skipped with ___ lookups
1 parent 2e16112 commit 3063064

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

polymorphic/query.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ class self.model, but as a class derived from self.model. We want to re-fetch
393393
# now a superclass of real_concrete_class. Thus it's
394394
# sufficient to just use the field name.
395395
translated_field_name = field.rpartition('___')[-1]
396+
397+
# Check if the field does exist.
398+
# Ignore deferred fields that don't exist in this subclass type.
396399
try:
397400
real_concrete_class._meta.get_field(translated_field_name)
398401
except FieldDoesNotExist:

0 commit comments

Comments
 (0)