Skip to content

Commit 605c1fa

Browse files
committed
Merge pull request #2397 from travelton/TweakTutorialDocs
Tweaked a few issues in the tutorial documentation.
2 parents 7e921ca + 8ccf5bc commit 605c1fa

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

docs/tutorial/1-serialization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Our `SnippetSerializer` class is replicating a lot of information that's also co
191191
In the same way that Django provides both `Form` classes and `ModelForm` classes, REST framework includes both `Serializer` classes, and `ModelSerializer` classes.
192192

193193
Let's look at refactoring our serializer using the `ModelSerializer` class.
194-
Open the file `snippets/serializers.py` again, and edit the `SnippetSerializer` class.
194+
Open the file `snippets/serializers.py` again, and replace the `SnippetSerializer` class with the following.
195195

196196
class SnippetSerializer(serializers.ModelSerializer):
197197
class Meta:

docs/tutorial/3-class-based-views.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ That's looking good. Again, it's still pretty similar to the function based vie
6464

6565
We'll also need to refactor our `urls.py` slightly now we're using class based views.
6666

67-
from django.conf.urls import patterns, url
67+
from django.conf.urls import url
6868
from rest_framework.urlpatterns import format_suffix_patterns
6969
from snippets import views
7070

docs/tutorial/4-authentication-and-permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ In the snippets app, create a new file, `permissions.py`
177177
# Write permissions are only allowed to the owner of the snippet.
178178
return obj.owner == request.user
179179

180-
Now we can add that custom permission to our snippet instance endpoint, by editing the `permission_classes` property on the `SnippetDetail` class:
180+
Now we can add that custom permission to our snippet instance endpoint, by editing the `permission_classes` property on the `SnippetDetail` view class:
181181

182182
permission_classes = (permissions.IsAuthenticatedOrReadOnly,
183183
IsOwnerOrReadOnly,)

docs/tutorial/5-relationships-and-hyperlinked-apis.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ If we're going to have a hyperlinked API, we need to make sure we name our URL p
106106

107107
After adding all those names into our URLconf, our final `snippets/urls.py` file should look something like this:
108108

109+
from django.conf.urls import url, include
110+
109111
# API endpoints
110112
urlpatterns = format_suffix_patterns([
111113
url(r'^$', views.api_root),

0 commit comments

Comments
 (0)