I want to serialize the data
class Main(models.Model): title = models.CharField() class ForeignKey(models.Model): main = models.ForeignKey(Main,on_related='foreign_key')
I want to get the result like
I first thought I could make it work in the 'views.py', but some documents told me that there is a thing like 'listField' in serializer, which has too little examples..
What would be the way here?