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


  • 0
    joel-robinson-10375  12 years ago

    I can't seem to figure out how to do and AND query. I tried somthing like this:

    return dict(customer=JqGrid(globals(), db.customer, query=db.customer.lastname==session.lastname & db.customer.phone==session.phone)())

    How can I combine queries?

    Thanks for you help.

    replies (1)
    • iiijjjiii 12 years ago

      Use braces around the queries. Try:

      return dict(customer=JqGrid(globals(), db.customer, query=((db.customer.lastname==session.lastname) & (db.customer.phone==session.phone)))())

Commented on:

Here is a JqGrid application that includes a JqGrid module that allows you to insert jqgrid tables in web2py pages using python. git clone https://iiijjjii@github.com/iiijjjii/jqgrid.git The module includes functionality for searching and form editing as well as the general features, pagination, sorting on columns, formatting and navigating available with jqgrid. The application includes examples of usage in the default.py controller.

Hosting graciously provided by:
Python Anywhere