SQLFORM.grid, best approach for searching in ID type field

19 views
Skip to first unread message

Luciano Bovio

unread,
Jul 6, 2020, 6:24:40 PM7/6/20
to web2py-users
I am reading a table from another application just to perform searches. I am using SQLFORM.grid, my problem is that i need to search for 'product_code' field that in my DAL i have mapped as ID. I have no rights to write fields on remote DB.

/models/remote_server.py
    db1.define_table('web_products',
        Field('product_code','id'),
        Field('product_desc','string'),
        migrate=False)

/controllers/example_search.py
    def index():
        grid=SQLFORM.grid(db1.web_products)
        return dict(grid=grid)

Which will be the right way to perform a search in that field ? Do i explain myself correctly ?

Thanks

Reply all
Reply to author
Forward
0 new messages