If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    paulgerrard  14 years ago
    I have a complicated query as a data source and the filter drop downs contain items that aren't in the records displayed in the grid. I understand I should use the 'grid.filter_items_query' field and ave done - but it seems to make no difference. I get many more entries in the drop down than are in the grid. Here's the two lines of code that are relevant. Any ideas?
    grid.datasource = db((db.stories.priority_id==db.storypriority.id) & (db.stories.assigned_id==db.auth_user.id) & \
            (db.stories.status_id==db.storystatus.id) & (db.stories.app_id==db.applications.id) & \
            (db.applications.org_id==session.org_id))
        grid.filter_items_query = lambda field: (db.stories.app_id==db.applications.id) & (db.applications.org_id==session.org_id)
    

Commented on:

This is a module that lets you build a table on the server that supports paging, sorting, editing and totals easily. It requires no javascript or sessions to work.

Hosting graciously provided by:
Python Anywhere