1class entry_ViewSet(viewsets.ModelViewSet):
2 queryset = Entry.objects.all()
3 serializer_class= EntrySerializer
4 permission_classes = (permissions.IsAuthenticatedOrReadOnly,IsOwnerOrReadOnly,)
5
6 def create(self, request, *args, **kwargs):
7 response = super(entry_ViewSet, self).create(request, *args, **kwargs)
8 # here may be placed additional operations for
9 # extracting id of the object and using reverse()
10 return HttpResponseRedirect(redirect_to='https://google.com')
11
12 def perform_create(self, serializer):
13 serializer.partial = True
14 serializer.save(created_by=self.request.user)
15