Re: Deduping a queryset based on one field

2007-06-12 Thread Malcolm Tredinnick
On Tue, 2007-06-12 at 22:20 +, bahund wrote: > I have a Searchlog model, and I'm trying to build a queryset of all > unique searches ('searchstr' field). Using distinct() doesn't seem to > work because the pk will always be different. Ideally, I'd like to > use distinct() in a way where I co

Deduping a queryset based on one field

2007-06-12 Thread bahund
I have a Searchlog model, and I'm trying to build a queryset of all unique searches ('searchstr' field). Using distinct() doesn't seem to work because the pk will always be different. Ideally, I'd like to use distinct() in a way where I could pass it the field I want to be unique, such as: quer