you can try building the query with DAL like the following:

sql = db(db.t1)._select(orderby=[db.t1.f1])
db.executesql(sql + ' NULLS FIRST')



2015-06-22 10:43 GMT+02:00 pysab <pysabw...@gmail.com>:

> ok, thanks. Raw SQL is my friend then ;)
>
>
>
> On Wednesday, 17 June 2015 09:18:38 UTC+2, Niphlod wrote:
>>
>> nope.
>>
>> On Wednesday, June 17, 2015 at 8:57:45 AM UTC+2, pysab wrote:
>>>
>>> Hi there :)
>>>
>>> I'm using web2py 2.9.10 with a database PostgreSQL 9.4 for a new project
>>> and I have a question about sorting. In PostgreSQL, when I execute a
>>> SELECT, I can specify 'ORDER BY x ASC NULLS FIRST', which is not the
>>> default output. Is there a way to do that with the DAL other than writing a
>>> raw SQL query?
>>>
>>> Thanks!
>>>
>>>  --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> 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 web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to