In example 34 below, is there a way to automatically get personID and 
productID into the purchase table without needing to select them if the 
person was already associating with the product?

Let's say, Joe chooses to buy something from my store.  He clicks on the 
product which takes him to smartgrid create-a-purchase record.  

I think smartgrid makes him take an unnecessary step of choosing his name 
from a list of registered users, then, goes to another unnecessary step to 
make him select the product from the product database.

Basically I'm asking that when creating a parent and detail record, how do 
I automatically get the parent primary key into the child foreign key? Does 
example 32 above with SQLFORM<http://www.web2py.com/init/global/vars/SQLFORM>
.factory do what I'm seeking?

Thanks,

Alex Glaros

http://www.web2py.com/init/default/examples
Example 34 *Using a Smartgrid*

All of the above database examples can be condensed in one simple command 
using the SQLFORM.smartgrid:

1.
2.
3.
4.

def manage_transactions():
    grid = SQLFORM 
<http://www.web2py.com/init/global/vars/SQLFORM>.smartgrid(db.person,linked_tables=['product','purchase'],
                             user_signature=False)
    return dict(grid=grid)

-- 

--- 
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/groups/opt_out.


Reply via email to