The Ordered Fields section of the documentation should mention this third method which is supported by the renderer:
# Try to pull the header off of the data, if it's not passed in as an
# argument.
if not header and hasattr(data, 'header'):
header = data.header
This can be accomplished by using a subclass of list:
class AttributeList(list):
"""A list which can have attributes added."""
alist = AttributeList(rows_list)
alist.header = column_names_list
return Response(alist)
The Ordered Fields section of the documentation should mention this third method which is supported by the renderer:
This can be accomplished by using a subclass of list: