smartgrid orderby descending

398 views
Skip to first unread message

Jake Lowen

unread,
Apr 21, 2013, 10:47:59 AM4/21/13
to web...@googlegroups.com
In a normal grid the orderby descending works just fine:

grid = SQLFORM.grid(db.meetings,
        orderby=~db.meetings.meeting_date,
    )

But I can't get the parent table of a smart group to sort the same way:

grid = SQLFORM.smartgrid(db.meetings,
        linked_tables=['meeting_docs'],
        orderby=dict(parent=~db.meetings.meeting_date, child=None),
    )

What is the correct syntax to descent sort the parent table in a smartgrid?

Anthony

unread,
Apr 21, 2013, 3:24:40 PM4/21/13
to web...@googlegroups.com
I believe the keys of the orderby dict should be the actual table names, not the literal keys "parent" and "child".

Anthony

Dan Kozlowski

unread,
Mar 7, 2014, 7:41:27 PM3/7/14
to web...@googlegroups.com
Jake,

Did you ever get this to work ? Reason being I think I have the same problem.

Jake Lowen

unread,
Mar 10, 2014, 3:09:00 PM3/10/14
to web...@googlegroups.com
Hi Dan.  Sorry, but I can't remember if I ever got that problem solved.  I did have this response to the question "I believe the keys of the orderby dict should be the actual table names, not the literal keys "parent" and "child"."

I've not actually touched web2py in a while since I moved on to flask. Sorry I'm not more help.

J


--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/0XlEIXuCaG8/unsubscribe.

To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages