Add extra comment why deferred fields are skipped with ___ lookups

fix_request_path_info
Diederik van der Boor 2017-09-30 20:26:52 +02:00
parent 2e16112cbe
commit 30630647c4
1 changed files with 3 additions and 0 deletions

View File

@ -393,6 +393,9 @@ class PolymorphicQuerySet(QuerySet):
# now a superclass of real_concrete_class. Thus it's # now a superclass of real_concrete_class. Thus it's
# sufficient to just use the field name. # sufficient to just use the field name.
translated_field_name = field.rpartition('___')[-1] translated_field_name = field.rpartition('___')[-1]
# Check if the field does exist.
# Ignore deferred fields that don't exist in this subclass type.
try: try:
real_concrete_class._meta.get_field(translated_field_name) real_concrete_class._meta.get_field(translated_field_name)
except FieldDoesNotExist: except FieldDoesNotExist: