In DRF, I can serialize a native Python object like this:
class Comment(object):
def __init__(self, email, content, created=None):
self.email = e
You can simply add many=True for serialising list.
comments = [Comment(email='leila@example.com', content='foo bar'),
Comment(email='leila1@example.com', content='foo bar 1'),
Comment(email='leila2@example.com', content='foo bar 2')]
serializer = CommentSerializer(comments, many=True)
serializer.data