mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 05:04:31 +03:00
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
This commit is contained in:
commit
9d59e55cec
|
@ -160,7 +160,7 @@ You won't typically need to override the following methods, although you might n
|
||||||
* `get_serializer(self, instance=None, data=None, files=None, many=False, partial=False)` - Returns a serializer instance.
|
* `get_serializer(self, instance=None, data=None, files=None, many=False, partial=False)` - Returns a serializer instance.
|
||||||
* `get_pagination_serializer(self, page)` - Returns a serializer instance to use with paginated data.
|
* `get_pagination_serializer(self, page)` - Returns a serializer instance to use with paginated data.
|
||||||
* `paginate_queryset(self, queryset)` - Paginate a queryset if required, either returning a page object, or `None` if pagination is not configured for this view.
|
* `paginate_queryset(self, queryset)` - Paginate a queryset if required, either returning a page object, or `None` if pagination is not configured for this view.
|
||||||
* `filter_queryset(self, queryset)` - Given a queryset, filter it with whichever filter backend is in use, returning a new queryset.
|
* `filter_queryset(self, queryset)` - Given a queryset, filter it with whichever filter backends are in use, returning a new queryset.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,7 @@ The following people have helped make REST framework great.
|
||||||
* Matt Majewski - [forgingdestiny]
|
* Matt Majewski - [forgingdestiny]
|
||||||
* Jerome Chen - [chenjyw]
|
* Jerome Chen - [chenjyw]
|
||||||
* Andrew Hughes - [eyepulp]
|
* Andrew Hughes - [eyepulp]
|
||||||
|
* Daniel Hepper - [dhepper]
|
||||||
|
|
||||||
Many thanks to everyone who's contributed to the project.
|
Many thanks to everyone who's contributed to the project.
|
||||||
|
|
||||||
|
@ -273,3 +274,4 @@ You can also contact [@_tomchristie][twitter] directly on twitter.
|
||||||
[forgingdestiny]: https://github.com/forgingdestiny
|
[forgingdestiny]: https://github.com/forgingdestiny
|
||||||
[chenjyw]: https://github.com/chenjyw
|
[chenjyw]: https://github.com/chenjyw
|
||||||
[eyepulp]: https://github.com/eyepulp
|
[eyepulp]: https://github.com/eyepulp
|
||||||
|
[dhepper]: https://github.com/dhepper
|
||||||
|
|
|
@ -204,7 +204,7 @@ We can also serialize querysets instead of model instances. To do so we simply
|
||||||
|
|
||||||
## Using ModelSerializers
|
## Using ModelSerializers
|
||||||
|
|
||||||
Our `SnippetSerializer` class is replicating a lot of information that's also contained in the `Snippet` model. It would be nice if we could keep out code a bit more concise.
|
Our `SnippetSerializer` class is replicating a lot of information that's also contained in the `Snippet` model. It would be nice if we could keep our code a bit more concise.
|
||||||
|
|
||||||
In the same way that Django provides both `Form` classes and `ModelForm` classes, REST framework includes both `Serializer` classes, and `ModelSerializer` classes.
|
In the same way that Django provides both `Form` classes and `ModelForm` classes, REST framework includes both `Serializer` classes, and `ModelSerializer` classes.
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ Once you've created a few code snippets, navigate to the '/users/' endpoint, and
|
||||||
|
|
||||||
## Object level permissions
|
## Object level permissions
|
||||||
|
|
||||||
Really we'd like all code snippets to be visible to anyone, but also make sure that only the user that created a code snippet is able update or delete it.
|
Really we'd like all code snippets to be visible to anyone, but also make sure that only the user that created a code snippet is able to update or delete it.
|
||||||
|
|
||||||
To do that we're going to need to create a custom permission.
|
To do that we're going to need to create a custom permission.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user