Im new to DRF. There are two models like:
class Article(models.Model):
title = models.CharField(max_length=100, unique=True)
class ArticleTag(models.Model):
article = models.ForeignKey(
Article, on_delete=models.CASCADE, related_name='tags')
tag = models.CharField(max_length=100)
I want the backend to return data like:
[{ title : 'Article1', tags : [ 'tag1', 'tag2' ]},{ title : 'Article2', tags : [ 'tag2', 'tag3' ]} ... ]
Is this possible? I have no idea how to combine data from different models.