Skip to content

Commit

Permalink
Merge pull request #2307 from epicserve/tutorial_6_doc_fix
Browse files Browse the repository at this point in the history
The pre_save method no longer works. This resolved issue #2306
  • Loading branch information
xordoquy committed Dec 17, 2014
2 parents b8af834 + 7e9aac9 commit e8b4641
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/tutorial/6-viewsets-and-routers.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Next we're going to replace the `SnippetList`, `SnippetDetail` and `SnippetHighl
snippet = self.get_object()
return Response(snippet.highlighted)

def pre_save(self, obj):
obj.owner = self.request.user
def perform_create(self, serializer):
serializer.save(owner=self.request.user)

This time we've used the `ModelViewSet` class in order to get the complete set of default read and write operations.

Expand Down

0 comments on commit e8b4641

Please sign in to comment.