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,
>
> 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
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,
>
> 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
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
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
>
> 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
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
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
>
> 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
10 matches
Mail list logo