From 9aa37260098b5ec2750090fb035945780b35ad1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Gro=C3=9F?= Date: Tue, 30 Oct 2012 13:50:07 +0100 Subject: [PATCH 1/6] fix ModelSerializer useage cause of: from snippets.models import Snippet --- docs/tutorial/1-serialization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/1-serialization.md b/docs/tutorial/1-serialization.md index 7330fdef2..0b84a7795 100644 --- a/docs/tutorial/1-serialization.md +++ b/docs/tutorial/1-serialization.md @@ -194,7 +194,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') From bcfb46eedc8fd7184e73a1fa6cecb1a359d1ef1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Gro=C3=9F?= Date: Tue, 30 Oct 2012 14:02:12 +0100 Subject: [PATCH 2/6] removed empty row --- docs/tutorial/3-class-based-views.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/tutorial/3-class-based-views.md b/docs/tutorial/3-class-based-views.md index 3d58fe8e7..f27b5af01 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) From abf7f1161933567e622c51af9a53e4b860c11693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Gro=C3=9F?= Date: Tue, 30 Oct 2012 14:11:36 +0100 Subject: [PATCH 3/6] fixed typo --- docs/tutorial/4-authentication-and-permissions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md index a0d7c5a67..2dc622194 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 From a967187b4102af88dec4d8a2b9ffd97b6c65db0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Gro=C3=9F?= Date: Tue, 30 Oct 2012 14:36:37 +0100 Subject: [PATCH 4/6] fixed typo --- docs/tutorial/4-authentication-and-permissions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md index 2dc622194..5a30082c5 100644 --- a/docs/tutorial/4-authentication-and-permissions.md +++ b/docs/tutorial/4-authentication-and-permissions.md @@ -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 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. From aa081678d5fecf6a17b411545571348e047c6846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Gro=C3=9F?= Date: Tue, 30 Oct 2012 14:38:23 +0100 Subject: [PATCH 5/6] added missing word --- docs/tutorial/4-authentication-and-permissions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md index 5a30082c5..ca6ab80ce 100644 --- a/docs/tutorial/4-authentication-and-permissions.md +++ b/docs/tutorial/4-authentication-and-permissions.md @@ -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 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 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. From 3216ac022419710485695a9a21f083f08e012a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Gro=C3=9F?= Date: Tue, 30 Oct 2012 14:53:38 +0100 Subject: [PATCH 6/6] added missing word + removed double whitespace --- docs/tutorial/4-authentication-and-permissions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md index ca6ab80ce..b0ed8f2a2 100644 --- a/docs/tutorial/4-authentication-and-permissions.md +++ b/docs/tutorial/4-authentication-and-permissions.md @@ -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.