On Fri, 4 May 2007 at 10:48, Thierry wrote:
>> greetings = [g.greeting for g in Greet.select()]
> How do you get DISTINCT greeting from the above?

I have a similar need in my own code (after a more complex
select).  This should work, and is pretty efficient according
to a set of python benchmark tests I read about:

greetings = list(set([g.greeting for g in Greet.select()]))

--David

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to