title: Django-Rest-Framework: Paginate nested object
body: <p>I have two models:</p>
  
  <pre><code>class Book(models.Model):
      title = models.CharField(max_length=250)
      author = models.CharField(max_length=250)
  class WordInBook(models.Model):
      book = models.ForeignKey("Book")
      word = models.ForeignKey("Word")
  </code></pre>
  
  <p>And corresponding serializers:</p>
  
  <pre><code>class BookSerializer(ModelSerializer):
      wordinbook_set = WordInBookSerializer(many=True)
  
      class Meta:
          model = Book
          fields = ('id', 'title', 'author', 'wordinbook_set')
  
  class WordInBookSerializer(ModelSerializer):
      class Meta:
          model = WordInBook
          fields = ('word')
  </code></pre>
  
  <p>Now I want to paginate the wordinbook_set. Outside of serialiser it is easy:</p>
  
  <pre><code>book = Book.objects.get(pk=book_id)
  paginator = Paginator(book.wordinbook_set.all(), 10)
  words = paginator.page(page).object_list
  </code></pre>
  
  <p>But that leaves me with two separate serialized objects.</p>
  
  <p>Question: how do I paginate wordinbook_set inside the serializer? <br>
  The resulting json should look like this:</p>
  
  <pre><code>{id: '...', title: '...', author: '...', wordinbook_set: [ 10 WordInBook objects here ]}
  </code></pre>