Django Rest Framework regroup queryset by a category
问题 In the current project that i'm working on, i need to regroup (group) a queryset by category and put contents with same category in a list all provided together. I have the following model structure: class Category(models.Model): title = models.CharField(max_length=255) class Item(models.Model): title = models.CharField(max_length=255) category = models.ForeignKey(to="Category", verbose_name=_('category'), related_name='items', on_delete=models.SET_NULL, null=True, blank=True) I would like