I'm developing an API with Django 1.11.11 and python 3.6.4. I have the following model:
class Subsection(models.Model):
genres = models.ManyToManyField(Genre, blank=True, default=None)
tags = models.ManyToManyField(Tag, blank=True, default=None)
And I'm doing the following query:
subsection = Subsection.objects.filter(**q_objects).prefetch_related('genres', 'tags').first()
So, then I can do:
genres = subsection.genres.all()
tags = subsection.tags.all()
However, this is doing new calls even the prefetch_related, what am I doing wrong?
Thanks in advance