Re: Annotate on related field

2016-07-22 Thread Todor Velichkov
By "retrieving the matching tags" you mean fetching `Tag` objects? Well I guess what you can do is to use `prefetch_related ` with custom `Prefetch

Annotate on related field

2016-07-12 Thread Ramashish Baranwal
Hi, I have the following model definitions: class Tag(models.Model): name = models.CharField(max_length=16) class Blog(models.Model): name = models.CharField(max_length=16) tags = models.ManyToManyField(Tag, blank=True) I want to select blogs with more than one tags. Here is what