The orderby should be a dict with the table_name as the key.  The value 
should be the orderby used for that specific table.

-Jim

On Tuesday, February 9, 2016 at 2:25:52 PM UTC-6, Vikash Sharma wrote:
>
>
> I have a smartgrid as follows
>
>
> *grid = SQLFORM.smartgrid(db.receipt, linked_tables=['items'], orderby="id 
> DESC")*
>
> Using this, *receipt *table is shown correctly as order in descending 
> order. But internal table *items* is also getting ordered in descending 
> order. 
>
> If I do  
>
> *grid = SQLFORM.smartgrid(db.receipt, linked_tables=['items'], 
> orderby="receipt.id <http://receipt.id> DESC")*
>
> Then *receipt* table is fine but on click/view for *items* table, it 
> gives error that *receipt.id <http://receipt.id>* is unknown column. 
>
> I want outer table ordered DESC but not internal/child table. 
>
> Please help. 
>
>

-- 
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