[web2py] Re: smartgrid with linked_tables and constraints broke the links

2017-04-05 Thread Rudy
Anthony, I can't thank you enough for all your advises and help, not only i understand more about the grid / smartgrid, but the use of request.args now. I appreciate a lot of your time. Rudy On Thursday, April 6, 2017 at 2:57:00 AM UTC+8, Anthony wrote: > > Pardon me for asking stupid question,

[web2py] Re: smartgrid with linked_tables and constraints broke the links

2017-04-05 Thread Anthony
> > Pardon me for asking stupid question, what does SQLFORM.smartgrid(., > args=request.args[:1], ...) really do? you mentioned in earlier post that > args must be a list, and it preserves the 1st argument of URL for > application specific use. Does it tell web2py whatever url it creates, i

[web2py] Re: smartgrid with linked_tables and constraints broke the links

2017-04-04 Thread Rudy
Hi Anthony, Pardon me for asking stupid question, what does SQLFORM.smartgrid(., args=request.args[:1], ...) really do? you mentioned in earlier post that args must be a list, and it preserves the 1st argument of URL for application specific use. Does it tell web2py whatever url it creates,

[web2py] Re: smartgrid with linked_tables and constraints broke the links

2017-04-04 Thread Anthony
> > here is the minimal app, and I did reproduce the problem and narrowed > where it broke. > In view_invoices() action, it checks if customer id args is provided, if > so it will take it in for invoice_query = db.invoice.customer==customer_id, > if not invoice_query = db.invoice.customer != N

[web2py] Re: smartgrid with linked_tables and constraints broke the links

2017-04-04 Thread Rudy
Hi Anthony, here is the minimal app, and I did reproduce the problem and narrowed where it broke. In view_invoices() action, it checks if customer id args is provided, if so it will take it in for invoice_query = db.invoice.customer==customer_id, if not invoice_query = db.invoice.customer != N

[web2py] Re: smartgrid with linked_tables and constraints broke the links

2017-03-31 Thread Anthony
It's not quite clear without seeing more code. I suggest you pack and attach a *minimal *app that reproduces the problem. Anthony On Thursday, March 30, 2017 at 5:57:09 PM UTC-4, Rudy wrote: > > Thanks Anthony for your explanation of request.args use with smartgrid, I > tried your suggestion, b

[web2py] Re: smartgrid with linked_tables and constraints broke the links

2017-03-31 Thread Anthony
> > invoice_grid = SQLFORM.smartgrid(db.invoice, args=request.args[:1], >> constraints=dict(invoice=invoice_query), >> linked_tables=dict(invoice=['item'], item=[])) >> >> Noted that i could select a set of invoices based on the customer_id I >> passed in through request.args(0), the only thing

[web2py] Re: smartgrid with linked_tables and constraints broke the links

2017-03-30 Thread Dave S
On Thursday, March 30, 2017 at 2:57:09 PM UTC-7, Rudy wrote: > > Thanks Anthony for your explanation of request.args use with smartgrid, I > tried your suggestion, but had the same error. I think i made a mistake in > the constraints in my earlier post (according to the documentation, > constr

[web2py] Re: smartgrid with linked_tables and constraints broke the links

2017-03-30 Thread Rudy
Thanks Anthony for your explanation of request.args use with smartgrid, I tried your suggestion, but had the same error. I think i made a mistake in the constraints in my earlier post (according to the documentation, constraints is a dict of tablename:query), here is what i have changed. invoic

[web2py] Re: smartgrid with linked_tables and constraints broke the links

2017-03-30 Thread Anthony
> > 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 invoi