Skip to content

Commit

Permalink
Merge pull request #41 from lerela/f/fix_viewsets_doc
Browse files Browse the repository at this point in the history
Fix viewsets doc
  • Loading branch information
MattBroach committed Aug 8, 2018
2 parents 3612fdf + 37b4039 commit 300ddb7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/viewsets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
ViewSets
========

For user with ViewSets and Routers, **drf-multiple-model** provides the ``MultipleModelAPIViewSet``. A simple configuration for using the provided ViewSet might look like::
For user with ViewSets and Routers, **drf-multiple-model** provides the ``ObjectMultipleModelAPIViewSet``. A simple configuration for using the provided ViewSet might look like::

from rest_framework import routers
from drf_multiple_model.viewsets import MultipleModelAPIViewSet
from drf_multiple_model.viewsets import ObjectMultipleModelAPIViewSet

class TextAPIView(MultipleModelAPIViewSet):
class TextAPIView(ObjectMultipleModelAPIViewSet):
queryList = [
(Play.objects.all(),PlaySerializer),
(Poem.objects.filter(style='Sonnet'),PoemSerializer),
Expand All @@ -19,6 +19,6 @@ For user with ViewSets and Routers, **drf-multiple-model** provides the ``Multip
router.register('texts', TextAPIView, base_name='texts')


**WARNING:** Because the MultipleModel views do not provide the ``queryset`` property, you **must** specify the ``base_name`` property when you register a ``MultipleModelAPIViewSet`` with a router.
**WARNING:** Because the ObjectMultipleModel views do not provide the ``queryset`` property, you **must** specify the ``base_name`` property when you register a ``ObjectMultipleModelAPIViewSet`` with a router.

The ``MultipleModelAPIViewSet`` has all the same configuration options as the ``MultipleModelAPIView`` object. For more information, see the :doc:`basic usage <basic-usage>` section.
The ``ObjectMultipleModelAPIViewSet`` has all the same configuration options as the ``ObjectMultipleModelAPIView`` object. For more information, see the :doc:`basic usage <basic-usage>` section.

0 comments on commit 300ddb7

Please sign in to comment.