On Fri, May 04, 2007 at 02:23:13PM -0400, [EMAIL PROTECTED] wrote:
> 
> 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()]))

It's in the SQLObject docs...

[g.greeting for g in Greet.select(distinct=True)]

Jason

Attachment: pgpOPygzOQCox.pgp
Description: PGP signature

Reply via email to