mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-10-31 07:57:55 +03:00 
			
		
		
		
	
						commit
						fb313f8098
					
				|  | @ -517,7 +517,9 @@ class ListSerializer(BaseSerializer): | |||
|         """ | ||||
|         List of object instances -> List of dicts of primitive datatypes. | ||||
|         """ | ||||
|         iterable = data.all() if (hasattr(data, 'all')) else data | ||||
|         # Dealing with nested relationships, data can be a Manager, | ||||
|         # so, first get a queryset from the Manager if needed | ||||
|         iterable = data.all() if isinstance(data, models.Manager) else data | ||||
|         return [ | ||||
|             self.child.to_representation(item) for item in iterable | ||||
|         ] | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user