Thank you so much. Is it possible to create the invoice and the details on
the same page?

Sent from my iPhone

On 24 Mar 2013, at 22:02, Alan Etkin <spame...@gmail.com> wrote:

Thank you. Can u pls provide a sample code for this?
>

Derived from the book example (at the end of the Chapter 7, in the
smartgrid section)

@auth.requires_login():
def invoice():
    constraints=dict(invoice=db.invoice.id==<the invoice id>,
                     details=db.details.invoice_id==<the invoice id>)
    grid = SQLFORM.smartgrid(db.invoice,
                             constraints=constraints,
                             linked_tables=['details'])
    return locals()


You'd need also a previous action to create the invoice or else use a one
time form to create the invoice the first time the user visits the page.

 --

---
You received this message because you are subscribed to a topic in the
Google Groups "web2py-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/web2py/E8KnPq0ZGqM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to
web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to