I have a model called
class UserTag(models.Model):
name = models.CharField(max_length=64, unique= True)
users = models.ManyToManyField(User)
I am trying to filter its contents based on the user like this
usertags = UserTag.objects.filter(users=request.user)
now I want a list of all the tag names for this particular query. I know I can probably use a loop
for tag in usertags:
tags.append(tag.name)
But what if a user has a 1000 tags? wont this slow down the response?
Is there a more efficient way to handling this?
If you just want the tag names, use a
values_listquery: