We might need to see some of your code, specifically your models.

Why do you have multiple tables?

I could see you having one table called "property" such as:

db.define_table('property',
  Field('location'),
  Field('size'),
  Field('rent'))

And then in your controller:

def search():
  if request.vars.orderby == 'size':
    orderby = db.property.size
  elif request.vars.orderby == 'rent':
    orderby = db.property.rent
  else:
    orderby = db.property.location
  properties = db(db.property.id>0).select(orderby=orderby).select()
  return dict(properties=properties)

Then a URL:

http://mysite.com/search?orderby=rent




On Saturday, July 2, 2016 at 4:36:17 AM UTC-7, pbt wrote:
>
> I am new to web2py .Thanks in advance. Please help me doing this. I have 
> multiple tables with one record in each table as shown in the screenshot.I 
> want to sort the tables using different parameters of the table. I want to 
> keep a drop-down to sort records according to rent,size,location,etc...
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to