you can't order on a "part" of a value.... either you do it leveraging your 
backend functions and pass the query as a string, or you store somewhere 
the "int" part (e.g. with a computed field) and use that one.
Or, if you're fine with ordering done using python, you can use the sort 
function...

http://web2py.com/books/default/chapter/29/06#find,-exclude,-sort


On Saturday, April 20, 2013 1:07:28 PM UTC+2, lucas wrote:
>
> how to do an orderby where in this case the first field is actually a 
> string field that stores like 11th or 1st, where in the orderby i want to 
> trim off the last two characters, then orderby those integers, or something 
> like
>
> rows = db(tCt.id>0).select(orderby=int(tCt.circuit_short[:-2]) | 
> tCt.county)
>
> which bugs right now but how do i do it without it bugging?  thanx in 
> advance.  lucas
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to