mirror of
				https://github.com/django/django.git
				synced 2025-10-30 09:06:13 +00:00 
			
		
		
		
	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:
		| @@ -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] == '': |     if fields[pk_idx] == None or fields[pk_idx] == '': | ||||||
|         obj = None |         obj = None | ||||||
|     elif field_names: |     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))) |         obj = klass(**dict(zip(field_names, fields))) | ||||||
|     else: |     else: | ||||||
|         obj = klass(*fields) |         obj = klass(*fields) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user