mirror of https://github.com/django/django.git
Fixed a regression in select_related
The regression was caused by the fix for #13781 (commit
f51e409a5f
). Reason was leaving
off some crucial lines when resolving a merge conflict.
This commit is contained in:
parent
71e14cf3aa
commit
1194a96999
|
@ -1446,6 +1446,10 @@ def get_cached_row(row, index_start, using, klass_info, offset=0,
|
|||
if fields[pk_idx] == None or fields[pk_idx] == '':
|
||||
obj = None
|
||||
elif field_names:
|
||||
fields = list(fields)
|
||||
for rel_field, value in parent_data:
|
||||
field_names.append(rel_field.attname)
|
||||
fields.append(value)
|
||||
obj = klass(**dict(zip(field_names, fields)))
|
||||
else:
|
||||
obj = klass(*fields)
|
||||
|
|
Loading…
Reference in New Issue