This commit is contained in:
Gabriel Massadas 2017-09-13 13:16:23 +00:00 committed by GitHub
commit 6404ab198e
2 changed files with 36 additions and 0 deletions

View File

@ -251,5 +251,36 @@ To create a base viewset class that provides `create`, `list` and `retrieve` ope
By creating your own base `ViewSet` classes, you can provide common behavior that can be reused in multiple viewsets across your API.
---
# Third party packages
The following third party packages are also available.
## Django Efficient Rest
The [Django-Efficient-Rest][Django-Efficient-Rest] Implements a new type of ViewSets that works with Models like the default one and advanced Services like switching user accounts or connecting to a social network
Checkout this example were we check if a username is avaliable or not:
class api_auth(service):
class Meta:
methods = ["POST"]
requires_action = True
requires_auth = False
def post_username(self):
username = self.getInputJson()["username"]
try:
user = User.objects.get(username=username)
return status.HTTP_409_CONFLICT
except ObjectDoesNotExist:
return status.HTTP_202_ACCEPTED
To learn more read our documentation here [Django-Efficient-Rest-Wiki][Django-Efficient-Rest-Wiki]
[cite]: http://guides.rubyonrails.org/routing.html
[routers]: routers.md
[Django-Efficient-Rest]: https://github.com/G4brym/Django-Efficient-Rest
[Django-Efficient-Rest-Wiki]: https://github.com/G4brym/Django-Efficient-Rest/wiki

View File

@ -222,6 +222,10 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque
* [djangorestframework-bulk][djangorestframework-bulk] - Implements generic view mixins as well as some common concrete generic views to allow to apply bulk operations via API requests.
* [django-rest-multiple-models][django-rest-multiple-models] - Provides a generic view (and mixin) for sending multiple serialized models and/or querysets via a single API request.
### ViewSets
* [Django-Efficient-Rest][Django-Efficient-Rest] - Implements a new type of ViewSets that works with Models like the default one and advanced Services like switching user accounts or connecting to a social network
### Routers
* [drf-nested-routers][drf-nested-routers] - Provides routers and relationship fields for working with nested resources.
@ -335,3 +339,4 @@ To submit new content, [open an issue][drf-create-issue] or [create a pull reque
[djangorestframework-queryfields]: https://github.com/wimglenn/djangorestframework-queryfields
[drfpasswordless]: https://github.com/aaronn/django-rest-framework-passwordless
[djangorest-alchemy]: https://github.com/dealertrack/djangorest-alchemy
[Django-Efficient-Rest]: https://github.com/G4brym/Django-Efficient-Rest