Hiding  errors in SQLFORM.grid?

for example:
form = SQLFORM(db.table):
if form.accepts(request.vars, hideerror=True):
   ....

In SQLFORM.grid?

El viernes, 14 de septiembre de 2012 08:25:45 UTC-3, Gerd escribió:
>
> Hi!
>
> I receive the following error
>
> Traceback (most recent call last):
>   File "/home/gniemetz/webapps/web2py/web2py/gluon/restricted.py", line 209, 
> in restricted
>     exec ccode in environment
>   File 
> "/home/gniemetz/webapps/web2py/web2py/applications/tauchbuch/controllers/default.py"
>  <https://tauchbuch.niemetz.it/admin/edit/tauchbuch/controllers/default.py>, 
> line 92, in <module>
>   File "/home/gniemetz/webapps/web2py/web2py/gluon/globals.py", line 186, in 
> <lambda>
>     self._caller = lambda f: f()
>   File "/home/gniemetz/webapps/web2py/web2py/gluon/tools.py", line 2809, in f
>     return action(*a, **b)
>   File 
> "/home/gniemetz/webapps/web2py/web2py/applications/tauchbuch/controllers/default.py"
>  <https://tauchbuch.niemetz.it/admin/edit/tauchbuch/controllers/default.py>, 
> line 16, in index
>     if grid.errors:
> AttributeError: 'DIV' object has no attribute 'errors'
>
>
>
> This is the controller
>
> @auth.requires_login()
> def index():
>     grid = SQLFORM 
> <https://web2py.niemetz.it/examples/global/vars/SQLFORM>.grid(db.Logbuch,fields=[db.Logbuch.Datum,db.Logbuch.Kurs,db.Logbuch.Thema,db.Logbuch.Kommentar],maxtextlength=50,orderby=[~db.Logbuch.Datum],onvalidation=check_km)
>     if grid.errors:
>         response 
> <https://web2py.niemetz.it/examples/global/vars/response>.flash = 'Bitte 
> Eingaben überprüfen'
>     return locals()
>
> def check_km(form):
>     if form.vars.KM_Beginn >= form.vars.KM_Ende:
>         form.errors.KM_Ende = 'KM-Stand Ende kleiner/gleich KM-Stand Beginn'
>
>
> What i'm trying to do is to set response.flash
>
> What am i doing wrong here?
>
> Thanks,
> regards
> Gerd
>
>
>

-- 

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


Reply via email to