Shouldn't it be *form.errors*?
On Monday, October 7, 2013 11:20:32 PM UTC+2, raferbop wrote:
>
> # Model/db.py
>
> db = DAL('sqlite://storage.sqlite')
>
> db.define_table(
> 'person',
> Field('name', requires=IS_NOT_EMPTY(error_message=auth.messages.
> is_empty)),
> Field('email', requires=IS_EMAIL(error_message=auth.messages.
> invalid_email)),
> Field('password', requires=[IS_STRONG(), CRYPT()]))
>
> # Contoller/default.py
>
> def form_a():
> form = SQLFORM(db.person)
> if form.process(session=None).accepted:
> response.flash = 'form accepted'
> elif form.error:
> response.flash = 'form has errors'
> else:
> response.flash = 'please fill out the form'
> return dict(form=form)
>
> # View
>
> {{extend 'layout.html'}}
> <h1>Register Now</h1>
>
> <br />
> {{=form}}
> <br />
>
>
> The code highlighted above returns the following error;
>
> <type 'exceptions.AttributeError'> 'SQLFORM' object has no attribute
> 'error'
>
--
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/groups/opt_out.