Re: distinct rows problem

2006-03-05 Thread Russell Keith-Magee
On 3/6/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Yeah... it looks like count(distinct(*)) queries are not being > constructed. I just tested the equivalent case in the magic-removal > branch and it's doing the wrong thing there. > > Can you file a ticket about this, please? Then we won'

Re: distinct rows problem

2006-03-05 Thread Malcolm Tredinnick
Talking to myself, here; always a bad sign... On Mon, 2006-03-06 at 14:19 +1100, Malcolm Tredinnick wrote: > On Sun, 2006-03-05 at 18:06 -0800, tgone wrote: > > Malcolm Tredinnick wrote: > > > The 'fields' keyword argument is specific to get_values() because it > > > specifies the fields you want

Re: distinct rows problem

2006-03-05 Thread Malcolm Tredinnick
On Sun, 2006-03-05 at 18:06 -0800, tgone wrote: > Malcolm Tredinnick wrote: > > The 'fields' keyword argument is specific to get_values() because it > > specifies the fields you want returned. The get_count() method returns > > an integer -- you don't get a choice there -- so there is no 'fields'

Re: distinct rows problem

2006-03-05 Thread tgone
Malcolm Tredinnick wrote: > The 'fields' keyword argument is specific to get_values() because it > specifies the fields you want returned. The get_count() method returns > an integer -- you don't get a choice there -- so there is no 'fields' > argument required or permitted, only lookup constraint

Re: distinct rows problem

2006-03-05 Thread Malcolm Tredinnick
On Mon, 2006-03-06 at 01:46 +, tgone wrote: > Malcolm, > > You make a good point. here is the working code: > > search_results = catalogs.get_values(fields=['artist'], > order_by=['artist'], artist__icontains=form["searchquery"], > distinct=True) > > I forgot to specify the distinct field t

Re: distinct rows problem

2006-03-05 Thread tgone
Malcolm, You make a good point. here is the working code: search_results = catalogs.get_values(fields=['artist'], order_by=['artist'], artist__icontains=form["searchquery"], distinct=True) I forgot to specify the distinct field that I wanted to return (fields=['artist']). Simple mistake. Howev

Re: distinct rows problem

2006-03-05 Thread Malcolm Tredinnick
On Mon, 2006-03-06 at 01:23 +, tgone wrote: > nevermind, I figured it out. > > Django needs better documentation :) So can you post whatever you figure out to this thread as well. Otherwise people are just going to find your original email via a Google search without seeing the answer. If y

Re: distinct rows problem

2006-03-05 Thread tgone
nevermind, I figured it out. Django needs better documentation :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubsc

distinct rows problem

2006-03-05 Thread tgone
Hello, I'm building a search engine to find artists in my database. Naturally, I would like the results to be distinct without the artist names repeated. Here my code: search_results = catalogs.get_values(artist__icontains=form["searchquery"], distinct=True) I read the DB docs but I'm still st