Thierry Lam, el  4 de mayo a las 15:38 me escribiste:
> What if I also want to sort my query by group name, how should I do
> that? Should I go the lower level Select() way?
> 
> SELECT distinct name FROM user GROUP BY name

You want to get an ordered list? This should work:
names = list(set([u.name for u in users.select()]))
names.sort()

Again: this is a sub-optimal pythonic (no sql-aware) way to do it. But if
you are working with small sets it should work just fine.

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
 .------------------------------------------------------------------------,
  \  GPG: 5F5A8D05 // F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05 /
   '--------------------------------------------------------------------'
There is no such thing as right or wrong
Only consequences


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to