mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-10-31 07:57:55 +03:00 
			
		
		
		
	Merge remote-tracking branch 'shvechikov/master' into feature/3776
This commit is contained in:
		
						commit
						0051492963
					
				|  | @ -66,9 +66,10 @@ The following view demonstrates an example of using a serializer in a template f | ||||||
| 
 | 
 | ||||||
|         def post(self, request, pk): |         def post(self, request, pk): | ||||||
|             profile = get_object_or_404(Profile, pk=pk) |             profile = get_object_or_404(Profile, pk=pk) | ||||||
|             serializer = ProfileSerializer(profile) |             serializer = ProfileSerializer(profile, data=request.POST) | ||||||
|             if not serializer.is_valid(): |             if not serializer.is_valid(): | ||||||
|                 return Response({'serializer': serializer, 'profile': profile}) |                 return Response({'serializer': serializer, 'profile': profile}) | ||||||
|  |             serializer.save() | ||||||
|             return redirect('profile-list') |             return redirect('profile-list') | ||||||
| 
 | 
 | ||||||
| **profile_detail.html**: | **profile_detail.html**: | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user