Re: object value distinct for ForeignKey

2011-07-27 Thread Ian Clelland
On Wed, Jul 27, 2011 at 9:29 AM, Ian Clelland wrote: > > > On Mon, Jul 25, 2011 at 11:29 AM, Alfredo Alessandrini < > alfreal...@gmail.com> wrote: > >> Hi, >> >> I've a model testDB with a foreignkey "country" related to another >> database. >> >> I need to retrieve the unique value of country.co

Re: object value distinct for ForeignKey

2011-07-27 Thread Ian Clelland
On Mon, Jul 25, 2011 at 11:29 AM, Alfredo Alessandrini wrote: > Hi, > > I've a model testDB with a foreignkey "country" related to another > database. > > I need to retrieve the unique value of country.common_name. > > With this > > country_list = testDB.objects.values('country').distinct > > I c

object value distinct for ForeignKey

2011-07-25 Thread Alfredo Alessandrini
Hi, I've a model testDB with a foreignkey "country" related to another database. I need to retrieve the unique value of country.common_name. With this country_list = testDB.objects.values('country').distinct I can retrieve the unique value, but only the ID. In [63]: testDB.objects.values('cou