Do not call the .process method on a grid -- it automatically does the
processing itself. If you don't like the default flash messages, you can do:
if form.accepted:
or:
SQLFORM.grid(..., formargs=dict(message_onsuccess='form accepted',
message_onfailure='form has errors'))
Anthony
On Monday, July 21, 2014 6:43:00 AM UTC-4, Yebach wrote:
>
> Hello
>
> I have a SQLForm.grid.
>
> I want to create a response.flash message but on my if evaluation I get an
> error when my edit view is done
>
> <type 'exceptions.AttributeError'> 'DIV' object has no attribute 'process'
> even on my sqlform.grid view
>
> this is my controller function
>
> form = SQLFORM.grid(query=query,
> left=db.status.on(db.worker.w_status == db.status.id),
> fields=fields, searchable=True, orderby=default_sort_order,create=True,
> deletable=True, editable=True, paginate=25, buttons_placement = 'right')
> if form.process().accepted:
> response.flash = 'form accepted'
> elif form.errors:
> response.flash = 'form has errors'
> else:
> response.flash = 'please fill the form'
> # Note: no form instance is passed to the view
> return dict(form=form)
>
>
--
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.