Form object has no attribute 'to_python'

372 views
Skip to first unread message

Dominik Neumann

unread,
Jul 27, 2007, 1:39:01 PM7/27/07
to pylons-...@googlegroups.com
Hello,

i have an error when validating a Form:

class FilteringSchema(Schema):
filter_extra_fields = True
allow_extra_fields = True

class LoginForm(Form):
class fields(WidgetsList):
user_login = TextField(
validator = UnicodeString(not_empty=True)
)
user_password = PasswordField(
validator = UnicodeString(not_empty=True)
)
validator = FilteringSchema

login_form= LoginForm(..attribs.. ,action='process')

In the controller:

@validate(login_form, error_handler='index')
def process(self):
....

the rendering works without problems. But when i
submit the form i get following error:
||
exceptions.AttributeError: 'LoginForm' object has no attribute 'to_python'

So after some hours trying to dive into the code and looking the
examples, i can't get the solution :(

Thanks in advance,

Dominik

btw here my versions:
pylons: Pylons-0.9.6rc1-py2.4.egg
toscawidgets: ToscaWidgets-0.1a2dev_r3090-py2.4.egg
twForms: twForms-0.1a2dev_r3091-py2.4.egg


Dominik Neumann

unread,
Jul 28, 2007, 5:14:48 AM7/28/07
to pylons-...@googlegroups.com
Hello,

it works now :)

Problem was the import in base.py
from pylons.decorators import validate

due to this, my controller import
from toscawidgets.mods.pylonshf import validate

wasn't called ....

Regards,
Dominik


Reply all
Reply to author
Forward
0 new messages