title: Return results from multiple models with Django REST Framework
body: <p>I have three models — articles, authors and tweets. I'm ultimately needing to use Django REST Framework to construct a feed that aggregates all the objects using the Article and Tweet models into one reverse chronological feed.</p>
  
  <p>Any idea how I'd do that? I get the feeling I need to create a new serializer, but I'm really not sure.</p>
  
  <p>Thanks!</p>
  
  <p><strong>Edit:</strong> Here's what I've done thus far.</p>
  
  <p><em>app/serializers.py:</em></p>
  
  <pre><code>class TimelineSerializer(serializers.Serializer):
      pk = serializers.Field()
      title = serializers.CharField()
      author = serializers.RelatedField()
      pub_date = serializers.DateTimeField()
  </code></pre>
  
  <p><em>app/views.py:</em></p>
  
  <pre><code>class TimelineViewSet(viewsets.ModelViewSet):
      """
      API endpoint that lists all tweet/article objects in rev-chrono.
      """
      queryset = itertools.chain(Tweet.objects.all(), Article.objects.all())
      serializer_class = TimelineSerializer
  </code></pre>