Similar to the issue found here (and maybe here)
I had the problem of having a model like so:
class Item(models.Model):
name = models.CharField(max_length=128)
category = models.ForeignKey(Category)
class Category(models.Model):
name = models.CharField(max_lenght=64)
and wanting to serialize a list grouped by category like so:
[{'name': 'category 1', 'items: [ {'name': 'item1}, {'name':'item2'} ]},
{'name': 'category 2', 'items: [ {'name': 'item3}, {'name':'item4'} ]}]