aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2012-10-30 07:06:53 -0700
committerTom Christie2012-10-30 07:06:53 -0700
commita13aaea78debc63fce9c134a9a1ee2a0e3d3236c (patch)
tree2cf737bc19e4d0255c0e5a6b8f368ace695158eb
parent4cdd0b845e10c433358f210c84a2b3fe28543c68 (diff)
parent3216ac022419710485695a9a21f083f08e012a7f (diff)
downloaddjango-rest-framework-a13aaea78debc63fce9c134a9a1ee2a0e3d3236c.tar.bz2
Merge pull request #341 from minddust/restframework2
fix ModelSerializer useage
-rw-r--r--docs/tutorial/1-serialization.md2
-rw-r--r--docs/tutorial/3-class-based-views.md1
-rw-r--r--docs/tutorial/4-authentication-and-permissions.md6
3 files changed, 4 insertions, 5 deletions
diff --git a/docs/tutorial/1-serialization.md b/docs/tutorial/1-serialization.md
index 77a7641f..5cf16a67 100644
--- a/docs/tutorial/1-serialization.md
+++ b/docs/tutorial/1-serialization.md
@@ -200,7 +200,7 @@ Open the file `snippets/serializers.py` again, and edit the `SnippetSerializer`
class SnippetSerializer(serializers.ModelSerializer):
class Meta:
- model = models.Snippet
+ model = Snippet
fields = ('pk', 'title', 'code', 'linenos', 'language', 'style')
diff --git a/docs/tutorial/3-class-based-views.md b/docs/tutorial/3-class-based-views.md
index 3d58fe8e..f27b5af0 100644
--- a/docs/tutorial/3-class-based-views.md
+++ b/docs/tutorial/3-class-based-views.md
@@ -36,7 +36,6 @@ So far, so good. It looks pretty similar to the previous case, but we've got be
"""
Retrieve, update or delete a snippet instance.
"""
-
def get_object(self, pk):
try:
return Snippet.objects.get(pk=pk)
diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md
index a0d7c5a6..b0ed8f2a 100644
--- a/docs/tutorial/4-authentication-and-permissions.md
+++ b/docs/tutorial/4-authentication-and-permissions.md
@@ -19,7 +19,7 @@ Add the following two fields to the model.
We'd also need to make sure that when the model is saved, that we populate the highlighted field, using the `pygments` code higlighting library.
-We'll ned some extra imports:
+We'll need some extra imports:
from pygments.lexers import get_lexer_by_name
from pygments.formatters import HtmlFormatter
@@ -100,7 +100,7 @@ Add the following field to the serializer definition:
**Note**: Make sure you also add `'owner',` to the list of fields in the inner `Meta` class.
-This field is doing something quite interesting. The `source` argument controls which attribtue is used to populate a field, and can point at any attribute on the serialized instance. It can also take the dotted notation shown above, in which case it will traverse the given attributes, in a similar way as is used with Django's template language.
+This field is doing something quite interesting. The `source` argument controls which attribute is used to populate a field, and can point at any attribute on the serialized instance. It can also take the dotted notation shown above, in which case it will traverse the given attributes, in a similar way as it is used with Django's template language.
The field we've added is the untyped `Field` class, in contrast to the other typed fields, such as `CharField`, `BooleanField` etc... The untyped `Field` is always read-only, and will be used for serialized representations, but will not be used for updating model instances when they are deserialized.
@@ -120,7 +120,7 @@ Add the following property to **both** the `SnippetList` and `SnippetInstance` v
## Adding login to the Browseable API
-If you open a browser and navigate to the browseable API at the moment, you'll find you're no longer able to create new code snippets. In order to do so we'd need to be able to login as a user.
+If you open a browser and navigate to the browseable API at the moment, you'll find that you're no longer able to create new code snippets. In order to do so we'd need to be able to login as a user.
We can add a login view for use with the browseable API, by editing our URLconf once more.