Consider this code:
> db.define_table('position',
> Field('name'),
> Field('sort_order', 'integer'),
> )
>
> db.define_table('person',
> Field('name'),
> Field('position', db.position),
> )
>
> #This sorts by the position.id
> db(db.person.name=='Bob').select(orderby=db.person.position)
>
> #This fails.
> db(db.person.name=='Bob').select(orderby=db.person.position.sort_order)
I want a list of people, ordered by their position.sort_order, not
position.id . Does anyone know how this can be accomplished?
Thanks.
-nip
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---