Lets say I have a simple django model:
class Snippet(models.Model):
created = models.DateTimeField(auto_now_add=True)
title = models.CharField(max_length=100, blank=True, default='')
When I display info from it as JSON through the django web framework I get this:
[{"id": 1, "title": "hello"}, {"id": 2, "title": "world"}]
How would I add an array title to the generated JSON? Like so:
["books" :{"id": 1, "title": "hello"}, {"id": 2, "title": "world"}]
rest_framework.pagination.PaginationSerializerfor inspiration./api/books, so clients can derive the type of object from that. Probably this is why the framework has no provision for it.