diff --git a/docs/community/3.0-announcement.md b/docs/community/3.0-announcement.md
index 03a2c281c..66a035380 100644
--- a/docs/community/3.0-announcement.md
+++ b/docs/community/3.0-announcement.md
@@ -119,7 +119,7 @@ This would now be split out into two separate methods.
instance.save()
return instance
- def create(self, validated_data):
+ def create(self, validated_data):
return Snippet.objects.create(**validated_data)
Note that these methods should return the newly created object instance.
@@ -329,7 +329,7 @@ The `write_only_fields` option on `ModelSerializer` has been moved to `PendingDe
model = MyModel
fields = ('id', 'email', 'notes', 'is_admin')
extra_kwargs = {
- 'is_admin': {'write_only': True}
+ 'is_admin': {'write_only': True}
}
Alternatively, specify the field explicitly on the serializer class:
@@ -454,7 +454,7 @@ We can now use this class to serialize single `HighScore` instances:
def high_score(request, pk):
instance = HighScore.objects.get(pk=pk)
serializer = HighScoreSerializer(instance)
- return Response(serializer.data)
+ return Response(serializer.data)
Or use it to serialize multiple instances:
@@ -462,7 +462,7 @@ Or use it to serialize multiple instances:
def all_high_scores(request):
queryset = HighScore.objects.order_by('-score')
serializer = HighScoreSerializer(queryset, many=True)
- return Response(serializer.data)
+ return Response(serializer.data)
##### Read-write `BaseSerializer` classes.
@@ -493,8 +493,8 @@ Here's a complete example of our previous `HighScoreSerializer`, that's been upd
'player_name': 'May not be more than 10 characters.'
})
- # Return the validated values. This will be available as
- # the `.validated_data` property.
+ # Return the validated values. This will be available as
+ # the `.validated_data` property.
return {
'score': int(score),
'player_name': player_name
diff --git a/docs/community/3.2-announcement.md b/docs/community/3.2-announcement.md
index 8500a9892..c022231a0 100644
--- a/docs/community/3.2-announcement.md
+++ b/docs/community/3.2-announcement.md
@@ -83,7 +83,7 @@ When using `allow_null` with `ListField` or a nested `many=True` serializer the
For example, take the following field:
- NestedSerializer(many=True, allow_null=True)
+ NestedSerializer(many=True, allow_null=True)
Previously the validation behavior would be:
@@ -110,4 +110,4 @@ This release is planned to include:
* Improvements and public API for our templated HTML forms and fields.
* Nested object and list support in HTML forms.
-Thanks once again to all our sponsors and supporters.
\ No newline at end of file
+Thanks once again to all our sponsors and supporters.
diff --git a/docs/community/3.3-announcement.md b/docs/community/3.3-announcement.md
index 44e8dd511..87e70ee10 100644
--- a/docs/community/3.3-announcement.md
+++ b/docs/community/3.3-announcement.md
@@ -55,4 +55,4 @@ The `ModelSerializer` and `HyperlinkedModelSerializer` classes should now includ
[forms-api]: html-and-forms.md
[ajax-form]: https://github.com/encode/ajax-form
[jsonfield]: ../../api-guide/fields#jsonfield
-[django-supported-versions]: https://www.djangoproject.com/download/#supported-versions
\ No newline at end of file
+[django-supported-versions]: https://www.djangoproject.com/download/#supported-versions
diff --git a/docs/community/funding.md b/docs/community/funding.md
index d79b61b17..0faf2164b 100644
--- a/docs/community/funding.md
+++ b/docs/community/funding.md
@@ -174,23 +174,23 @@ This subscription is recommended for individuals with an interest in seeing REST
If you are using REST framework as a full-time employee, consider recommending that your company takes out a [corporate plan](#corporate-plans).
-
-
-
- {{ symbol }}
- {{ rates.personal1 }}
- /month{% if vat %} +VAT{% endif %}
-
-
Individual
-
-
- Support ongoing development
-
-
- Credited on the site
-
-
-
+
+
+
*Billing is monthly and you can cancel at any time.*
@@ -222,23 +222,23 @@ In exchange for funding you'll also receive advertising space on our site, allow
Our professional and premium plans also include **priority support**. At any time your engineers can escalate an issue or discussion group thread, and we'll ensure it gets a guaranteed response within the next working day.
-
-
-
- {{ symbol }}
- {{ rates.corporate1 }}
- /month{% if vat %} +VAT{% endif %}
-
-
Basic
-
-
- Support ongoing development
-
-
- Funding page ad placement
-
-
-
+
+
+
+ {{ symbol }}
+ {{ rates.corporate1 }}
+ /month{% if vat %} +VAT{% endif %}
+
+
Basic
+
+
+ Support ongoing development
+
+
+ Funding page ad placement
+
+
+
-
-
-
-
-
- {{ symbol }}
- {{ rates.corporate2 }}
- /month{% if vat %} +VAT{% endif %}
-
-
Professional
-
+
+
+
+
+
+ {{ symbol }}
+ {{ rates.corporate2 }}
+ /month{% if vat %} +VAT{% endif %}
+
+
Professional
+
Support ongoing development
-
- Sidebar ad placement
-
-
- Priority support for your engineers
-
-
-
+
+ Sidebar ad placement
+
+
+ Priority support for your engineers
+
+
+
-
-
-
-
-
- {{ symbol }}
- {{ rates.corporate3 }}
- /month{% if vat %} +VAT{% endif %}
-
-
Premium
-
+
+
+
+
+
+ {{ symbol }}
+ {{ rates.corporate3 }}
+ /month{% if vat %} +VAT{% endif %}
+
+
Premium
+
Support ongoing development
-
- Homepage ad placement
-
-
- Sidebar ad placement
-
-
- Priority support for your engineers
-
-
-
+
+ Homepage ad placement
+
+
+ Sidebar ad placement
+
+
+ Priority support for your engineers
+
+
+
-
-
-
+
+
+
@@ -346,22 +346,22 @@ In an effort to keep the project as transparent as possible, we are releasing [m
-
Stay up to date, with our monthly progress reports...
+
Stay up to date, with our monthly progress reports...
-
-
+
+
-
-
-
-
+
+
+
+
diff --git a/docs/community/mozilla-grant.md b/docs/community/mozilla-grant.md
index f20b65f4f..4d9b1d438 100644
--- a/docs/community/mozilla-grant.md
+++ b/docs/community/mozilla-grant.md
@@ -42,22 +42,22 @@ funded via the [REST framework paid plans](funding.md).
-
Stay up to date, with our monthly progress reports...
+
Stay up to date, with our monthly progress reports...
-
-
+
+
-
-
-
-
+
+
+
+
diff --git a/docs/index.md b/docs/index.md
index 4559542da..43332715d 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -147,11 +147,11 @@ Here's our project's root `urls.py` module:
from django.contrib.auth.models import User
from rest_framework import routers, serializers, viewsets
- # Serializers define the API representation.
- class UserSerializer(serializers.HyperlinkedModelSerializer):
- class Meta:
- model = User
- fields = ('url', 'username', 'email', 'is_staff')
+ # Serializers define the API representation.
+ class UserSerializer(serializers.HyperlinkedModelSerializer):
+ class Meta:
+ model = User
+ fields = ('url', 'username', 'email', 'is_staff')
# ViewSets define the view behavior.
class UserViewSet(viewsets.ModelViewSet):
diff --git a/docs/topics/writable-nested-serializers.md b/docs/topics/writable-nested-serializers.md
index cab700e5b..a39feb18c 100644
--- a/docs/topics/writable-nested-serializers.md
+++ b/docs/topics/writable-nested-serializers.md
@@ -12,17 +12,17 @@ Nested data structures are easy enough to work with if they're read-only - simpl
*Example of a **read-only** nested serializer. Nothing complex to worry about here.*
- class ToDoItemSerializer(serializers.ModelSerializer):
- class Meta:
- model = ToDoItem
- fields = ('text', 'is_completed')
+ class ToDoItemSerializer(serializers.ModelSerializer):
+ class Meta:
+ model = ToDoItem
+ fields = ('text', 'is_completed')
- class ToDoListSerializer(serializers.ModelSerializer):
- items = ToDoItemSerializer(many=True, read_only=True)
+ class ToDoListSerializer(serializers.ModelSerializer):
+ items = ToDoItemSerializer(many=True, read_only=True)
- class Meta:
- model = ToDoList
- fields = ('title', 'items')
+ class Meta:
+ model = ToDoList
+ fields = ('title', 'items')
Some example output from our serializer.
diff --git a/docs/tutorial/1-serialization.md b/docs/tutorial/1-serialization.md
index 7a9b7cbd8..aa94eeb0e 100644
--- a/docs/tutorial/1-serialization.md
+++ b/docs/tutorial/1-serialization.md
@@ -299,18 +299,18 @@ Now we can start up a sample server that serves our snippets.
Quit out of the shell...
- quit()
+ quit()
...and start up Django's development server.
- python manage.py runserver
+ python manage.py runserver
- Validating models...
+ Validating models...
- 0 errors found
- Django version 1.11, using settings 'tutorial.settings'
- Development server is running at http://127.0.0.1:8000/
- Quit the server with CONTROL-C.
+ 0 errors found
+ Django version 1.11, using settings 'tutorial.settings'
+ Development server is running at http://127.0.0.1:8000/
+ Quit the server with CONTROL-C.
In another terminal window, we can test the server.
diff --git a/docs/tutorial/4-authentication-and-permissions.md b/docs/tutorial/4-authentication-and-permissions.md
index 9af9c0940..ef5b45c90 100644
--- a/docs/tutorial/4-authentication-and-permissions.md
+++ b/docs/tutorial/4-authentication-and-permissions.md
@@ -83,7 +83,7 @@ We'll also add a couple of views to `views.py`. We'd like to just use read-only
Make sure to also import the `UserSerializer` class
- from snippets.serializers import UserSerializer
+ from snippets.serializers import UserSerializer
Finally we need to add those views into the API, by referencing them from the URL conf. Add the following to the patterns in `snippets/urls.py`.