Skip to content

Commit 735d225

Browse files
committed
2 parents bdacb66 + 3371131 commit 735d225

File tree

5 files changed

+16
-21
lines changed

5 files changed

+16
-21
lines changed

docs/api-guide/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Default:
7474

7575
#### DEFAULT_PERMISSION_CLASSES
7676

77-
A list or tuple of permission classes, that determines the default set of permissions checked at the start of a view.
77+
A list or tuple of permission classes, that determines the default set of permissions checked at the start of a view. Permission must be granted by every class in the list.
7878

7979
Default:
8080

docs/topics/3.0-announcement.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,13 @@ You can either return `non_field_errors` from the validate method by raising a s
189189

190190
def validate(self, attrs):
191191
# serializer.errors == {'non_field_errors': ['A non field error']}
192-
raise serailizers.ValidationError('A non field error')
192+
raise serializers.ValidationError('A non field error')
193193

194194
Alternatively if you want the errors to be against a specific field, use a dictionary of when instantiating the `ValidationError`, like so:
195195

196196
def validate(self, attrs):
197197
# serializer.errors == {'my_field': ['A field error']}
198-
raise serailizers.ValidationError({'my_field': 'A field error'})
198+
raise serializers.ValidationError({'my_field': 'A field error'})
199199

200200
This ensures you can still write validation that compares all the input fields, but that marks the error against a particular field.
201201

@@ -303,7 +303,7 @@ Alternatively, specify the field explicitly on the serializer class:
303303
model = MyModel
304304
fields = ('id', 'email', 'notes', 'is_admin')
305305

306-
The `read_only_fields` option remains as a convenient shortcut for the more common case.
306+
The `read_only_fields` option remains as a convenient shortcut for the more common case.
307307

308308
#### Changes to `HyperlinkedModelSerializer`.
309309

@@ -364,7 +364,7 @@ The `ListSerializer` class has now been added, and allows you to create base ser
364364
class MultipleUserSerializer(ListSerializer):
365365
child = UserSerializer()
366366

367-
You can also still use the `many=True` argument to serializer classes. It's worth noting that `many=True` argument transparently creates a `ListSerializer` instance, allowing the validation logic for list and non-list data to be cleanly separated in the REST framework codebase.
367+
You can also still use the `many=True` argument to serializer classes. It's worth noting that `many=True` argument transparently creates a `ListSerializer` instance, allowing the validation logic for list and non-list data to be cleanly separated in the REST framework codebase.
368368

369369
You will typically want to *continue to use the existing `many=True` flag* rather than declaring `ListSerializer` classes explicitly, but declaring the classes explicitly can be useful if you need to write custom `create` or `update` methods for bulk updates, or provide for other custom behavior.
370370

@@ -436,7 +436,7 @@ Here's a complete example of our previous `HighScoreSerializer`, that's been upd
436436
def to_internal_value(self, data):
437437
score = data.get('score')
438438
player_name = data.get('player_name')
439-
439+
440440
# Perform the data validation.
441441
if not score:
442442
raise ValidationError({
@@ -450,7 +450,7 @@ Here's a complete example of our previous `HighScoreSerializer`, that's been upd
450450
raise ValidationError({
451451
'player_name': 'May not be more than 10 characters.'
452452
})
453-
453+
454454
# Return the validated values. This will be available as
455455
# the `.validated_data` property.
456456
return {
@@ -463,15 +463,15 @@ Here's a complete example of our previous `HighScoreSerializer`, that's been upd
463463
'score': obj.score,
464464
'player_name': obj.player_name
465465
}
466-
466+
467467
def create(self, validated_data):
468468
return HighScore.objects.create(**validated_data)
469469

470470
#### Creating new generic serializers with `BaseSerializer`.
471471

472472
The `BaseSerializer` class is also useful if you want to implement new generic serializer classes for dealing with particular serialization styles, or for integrating with alternative storage backends.
473473

474-
The following class is an example of a generic serializer that can handle coercing aribitrary objects into primitive representations.
474+
The following class is an example of a generic serializer that can handle coercing aribitrary objects into primitive representations.
475475

476476
class ObjectSerializer(serializers.BaseSerializer):
477477
"""
@@ -542,7 +542,7 @@ The `default` argument is also available and always implies that the field is no
542542

543543
#### Coercing output types.
544544

545-
The previous field implementations did not forcibly coerce returned values into the correct type in many cases. For example, an `IntegerField` would return a string output if the attribute value was a string. We now more strictly coerce to the correct return type, leading to more constrained and expected behavior.
545+
The previous field implementations did not forcibly coerce returned values into the correct type in many cases. For example, an `IntegerField` would return a string output if the attribute value was a string. We now more strictly coerce to the correct return type, leading to more constrained and expected behavior.
546546

547547
#### The `ListField` class.
548548

@@ -695,7 +695,7 @@ These classes are documented in the [Validators](../api-guide/validators.md) sec
695695

696696
The view logic for the default method handlers has been significantly simplified, due to the new serializers API.
697697

698-
#### Changes to pre/post save hooks.
698+
#### Changes to pre/post save hooks.
699699

700700
The `pre_save` and `post_save` hooks no longer exist, but are replaced with `perform_create(self, serializer)` and `perform_update(self, serializer)`.
701701

@@ -887,4 +887,4 @@ The 3.2 release is planned to introduce an alternative admin-style interface to
887887

888888
You can follow development on the GitHub site, where we use [milestones to indicate planning timescales](https://github.com/tomchristie/django-rest-framework/milestones).
889889

890-
[mixins.py]: https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/mixins.py
890+
[mixins.py]: https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/mixins.py

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ When that's all done we'll need to update our database tables.
4444
Normally we'd create a database migration in order to do that, but for the purposes of this tutorial, let's just delete the database and start again.
4545

4646
rm tmp.db
47-
python manage.py syncdb
47+
rm -r snippets/migrations
48+
python manage.py makemigrations snippets
49+
python manage.py migrate
4850

4951
You might also want to create a few different users, to use for testing the API. The quickest way to do this will be with the `createsuperuser` command.
5052

docs/tutorial/6-viewsets-and-routers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To see what's going on under the hood let's first explicitly create a set of vie
6060

6161
In the `urls.py` file we bind our `ViewSet` classes into a set of concrete views.
6262

63-
from snippets.views import SnippetViewSet, UserViewSet
63+
from snippets.views import SnippetViewSet, UserViewSet, api_root
6464
from rest_framework import renderers
6565

6666
snippet_list = SnippetViewSet.as_view({

rest_framework/templates/rest_framework/base.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,6 @@ <h1>{{ name }}</h1>
237237
</div>
238238
<!-- END Content -->
239239
</div><!-- /.container -->
240-
241-
<footer>
242-
{% block footer %}
243-
<p>Sponsored by <a href="http://dabapps.com/">DabApps</a>.</p>
244-
{% endblock %}
245-
</footer>
246-
247240
</div><!-- ./wrapper -->
248241

249242
{% block script %}

0 commit comments

Comments
 (0)