Re: Simple query on a ManyToMany field?

2009-07-30 Thread Adam Olsen
On Thu, Jul 30, 2009 at 6:21 PM, Malcolm Tredinnick wrote: > I've written a couple of solutions for this over the years. Here's a > summary of some of them: > > http://www.pointy-stick.com/blog/2009/03/10/using-djangos-aggregation-features/ > That did it, thanks! -- Adam Olsen http://www.vimtip

Re: Simple query on a ManyToMany field?

2009-07-30 Thread Malcolm Tredinnick
On Thu, 2009-07-30 at 18:14 -0600, Adam Olsen wrote: > Suppose I have the following models: > > class Tag(models.Model): > card = models.ForeignKey('Card') > name = models.CharField(max_length=10) > > class Card(models.Model): > # whatever > > Say I have a list, like the following: w

Simple query on a ManyToMany field?

2009-07-30 Thread Adam Olsen
Suppose I have the following models: class Tag(models.Model): card = models.ForeignKey('Card') name = models.CharField(max_length=10) class Card(models.Model): # whatever Say I have a list, like the following: words = ['christmas', 'mother'] This list can be of variable length. How