On Monday, January 18, 2016 at 9:29:29 AM UTC-5, Diego Tostes wrote: > > Hi, > > i have a sqlform like this: > > > form = SQLFORM.grid(query=query_simulados, user_signature=False, > fields=fields, > ignore_rw=True, orderby=default_sort_order, > create=True, deletable=True, editable=True, > maxtextlength=64, paginate=40) > > > i need to set one of the fields as a default value, and i need to sqlform > redirect to a specific url after the a action at sqlfor (insert, edit, > delete) >
To set a default value for a given field, before creating the grid, do: db.mytable.myfield.default = 'my default' Regarding redirects, there are oncreate and onupdate arguments to the grid, which are callbacks that take the create/update form as an argument (ultimately, they are passed to form.process as the onsuccess argument). There is also an ondelete argument, which is a callback that takes the table name and the record ID. Anthony -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.