diff options
Diffstat (limited to 'django/db/models/query_utils.py')
| -rw-r--r-- | django/db/models/query_utils.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/django/db/models/query_utils.py b/django/db/models/query_utils.py index 3e644a3c26..5da3d81672 100644 --- a/django/db/models/query_utils.py +++ b/django/db/models/query_utils.py @@ -302,8 +302,9 @@ class RegisterLookupMixin: @staticmethod def merge_dicts(dicts): """ - Merge dicts in reverse to preference the order of the original list. e.g., - merge_dicts([a, b]) will preference the keys in 'a' over those in 'b'. + Merge dicts in reverse to preference the order of the original list. + e.g., merge_dicts([a, b]) will preference the keys in 'a' over those in + 'b'. """ merged = {} for d in reversed(dicts): @@ -435,8 +436,8 @@ def check_rel_lookup_compatibility(model, target_opts, field): # Restaurant.objects.filter(pk__in=Restaurant.objects.all()). # If we didn't have the primary key check, then pk__in (== place__in) would # give Place's opts as the target opts, but Restaurant isn't compatible - # with that. This logic applies only to primary keys, as when doing __in=qs, - # we are going to turn this into __in=qs.values('pk') later on. + # with that. This logic applies only to primary keys, as when doing + # __in=qs, we are going to turn this into __in=qs.values('pk') later on. return check(target_opts) or ( getattr(field, "primary_key", False) and check(field.model._meta) ) |
