>
> def view_invoices():
>     customer_id = request.args(0)
>     if customer_id:
>         invoice_query=db.invoice.customer==customer_id
>     else:
>         invoice_query=db.invoice.customer!=None 
>     constraints=dict(invoice=invoice_query)
>     db.item.invoice.writable=False #avoid invoice # from any particular 
> row in item table get overwritten
>     invoice_grid = SQLFORM.smartgrid(db.invoice, constraints=constraints)
>     return locals()
>

The grid and smartgrid use request.args internally to determine what is 
being requested, so if you also need to use request.args for additional 
data, you must tell the grid via the "args" argument. It appears you are 
using the first URL arg to specify a customer ID, so, do the following:

SQLFORM.smartgrid(..., args=request.args[:1])

Now, when the grid creates its own internal links, it will (a) preserve 
your arg as the first arg of each URL, and (b) read its own args starting 
with the second URL arg.

Note, the "args" argument must be a list, even if it includes only a single 
item.

Anthony 

-- 
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