[web2py] Re: How to make smartgrid redirect to edit after creating new record?

2017-04-04 Thread Shashank Upadhyay
thanks Adi it was really helpful On Friday, December 23, 2011 at 11:14:17 PM UTC+5:30, Adi wrote: > > this works: > > grid=SQLFORM.smartgrid(db.purchase_order, details=False, > links_in_grid=True, > maxtextlengths={'purchase_order.po_number':15,}, >

Re: [web2py] Re: How to make smartgrid redirect to edit after creating new record?

2013-09-15 Thread Adi
Untested, and modified sample: *Model:* db.define_table('purchase_order', Field('po_number', 'string', label=T('PO Number'), unique= True), Field('status', 'string', default='Processed', requires= IS_IN_SET(['Processed',

Re: [web2py] Re: How to make smartgrid redirect to edit after creating new record?

2013-09-15 Thread Alex Glaros
Thanks Adi, Alex On Sunday, September 15, 2013 5:33:36 AM UTC-7, Adi wrote: Untested, and modified sample: *Model:* db.define_table('purchase_order', Field('po_number', 'string', label=T('PO Number'), unique= True), Field('status', 'string',

Re: [web2py] Re: How to make smartgrid redirect to edit after creating new record?

2013-09-14 Thread Adnan Smajlovic
Alex, Can you please clarify what model do you need? I can post the sample code but not sure what exactly do you need. On Fri, Sep 13, 2013 at 8:13 PM, Alex Glaros alexgla...@gmail.com wrote: Adi, can you post the model for this? thanks, Alex Glaros On Friday, December 23, 2011

Re: [web2py] Re: How to make smartgrid redirect to edit after creating new record?

2013-09-14 Thread Alex Glaros
Adi, you had a tiny working example above *this works: grid=SQLFORM.smartgrid(.* is the data model available for that? I'm looking for any small self-contained working example of smartgrid redirecting to edit thanks, Alex On Saturday, September 14, 2013 5:38:58 PM UTC-7, Adi

[web2py] Re: How to make smartgrid redirect to edit after creating new record?

2013-09-13 Thread Alex Glaros
Adi, can you post the model for this? thanks, Alex Glaros On Friday, December 23, 2011 9:44:17 AM UTC-8, Adi wrote: this works: grid=SQLFORM.smartgrid(db.purchase_order, details=False, links_in_grid=True, maxtextlengths={'purchase_order.po_number':15,},

[web2py] Re: How to make smartgrid redirect to edit after creating new record?

2011-12-23 Thread Cliff
Hmm... doesn't seem to work. Controller below. As you can see, I've solved the puzzle to my satisfaction, but I would like to know why the call to oncreate misfires. def handle_create(form): # never happens print 'hello, world' def index(): fields = [db.owner.name, db.dog.id]

[web2py] Re: How to make smartgrid redirect to edit after creating new record?

2011-12-23 Thread Adi
this works: grid=SQLFORM.smartgrid(db.purchase_order, details=False, links_in_grid=True, maxtextlengths={'purchase_order.po_number':15,}, maxtextlength=30, paginate=20, sortable=True,

[web2py] Re: How to make smartgrid redirect to edit after creating new record?

2011-12-23 Thread Cliff
Adi, Is this 1.99.4? Is your controller named 'purchase_order'? Thanks, Cliff On Dec 23, 12:44 pm, Adi adnan.smajlo...@gmail.com wrote: this works:     grid=SQLFORM.smartgrid(db.purchase_order, details=False, links_in_grid=True,                        

[web2py] Re: How to make smartgrid redirect to edit after creating new record?

2011-12-23 Thread Adi
Hi Cliff, No. The name of the controller is default, but the table, on which smartgrid is operating is called purchase_order. Yes, it is the latest version. 1.99.4

[web2py] Re: How to make smartgrid redirect to edit after creating new record?

2011-12-23 Thread Adi
Hi Cliff, No. The name of the controller is default, but the table, on which smartgrid is operating is called purchase_order. Yes, it is the latest version. 1.99.4

[web2py] Re: How to make smartgrid redirect to edit after creating new record?

2011-12-22 Thread Cliff
Anyone? All ideas gratefully accepted. On Dec 21, 11:55 pm, Cliff cjk...@gmail.com wrote: Smartgrid is great when you have linked tables. But I know I'm going to get some user push back on adding records with linked tables. After adding a record, they like to go right back and edit the

[web2py] Re: How to make smartgrid redirect to edit after creating new record?

2011-12-22 Thread Adi
this is what i'm doing: in a smartgrid use oncreate = dict(purchase_order=[po_oncreation]), that takes you to your function after record is created, where you know the id. The argument you use is form. def po_oncreation(form): auth.archive last_id = form1.vars.id ...

[web2py] Re: How to make smartgrid redirect to edit after creating new record?

2011-12-22 Thread Cliff
Thanks. That's pretty close to what I was using, but I didn't have the syntax just right. Cliff Kachinske On Dec 22, 6:06 pm, Adi adnan.smajlo...@gmail.com wrote: this is what i'm doing: in a smartgrid use oncreate = dict(purchase_order=[po_oncreation]), that takes you to your function