On Sunday, March 13, 2016 at 7:04:56 PM UTC-5, Jeff Riley wrote:
>
> Hello everyone,
>
> I am so close to having my project finished.  I need to be able to 
> override the URL in the SQLFORM.grid 'Add Record' button.  I also have the 
> added problem in that I have linked tables in my grid and would like to 
> override their add buttons also.  I have gone through almost all the posts 
> on this site and have not come across one dealing with this.  Any help is 
> greatly appreciated.
>

Update:  Ok I think I figured it out.  At least it seems to be working.  I 
would love to know if this is a valid solution.

@auth.requires_membership('manager')
def manage_customers():
    if 'new' in request.args:
        if request.args(2) == 'customer':
            redirect(URL('new_customer'))
        elif request.args(4) == 'sheet':
            redirect(URL('new_sheet', args=request.args(2)))
    customers = SQLFORM.smartgrid(db.customer, linked_tables=['address', 
'sheet'],
                                 searchable= dict(customer=True, 
address=False, sheet=True),
                                 create=True, paginate=20, maxtextlength=60)
    return dict(customers=customers)

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