Re: distinct for ForeignKey field

2008-10-11 Thread Karen Tracey
On Sat, Oct 11, 2008 at 8:38 AM, Stephen Cheng <[EMAIL PROTECTED]>wrote: > > I am wondering how to get distinct values for a ForeignKey field > > For example: > class ModelA(models.Model): >. >city=models.ForeignKey(City) > distinct_cities = ModelA.values('

distinct for ForeignKey field

2008-10-11 Thread Stephen Cheng
I am wondering how to get distinct values for a ForeignKey field For example: class ModelA(models.Model): . city=models.ForeignKey(City) I understand that I can pass the list to template than probably use regroup and get the group values, but is there a ef