Hi all, I'm adding a new deform schema and form and I'm getting a KeyError
when it tries to render in mako.
Here is the schema:
@staticmethod
def checkedPasswordSchema():
return colander.SchemaNode(
colander.String(),
validator=deferred_password_validator,
widget=deform.widget.CheckedPasswordWidget(size=20),
description='Type your password and confirm it'),
here it is used:
reset_schema = ResetAccountSchema().bind()
reset_form = deform.Form(reset_schema)
# activating new user
return {
'user': user,
'reactivate_account_password_reset': True,
'reset_form': reset_form,
}
this the mako form:
<form formid="password_reset" method="post">
<div>
<div>
${func.render_input_field(reset_form['checked_password'])}
<input type="submit" name="submit" value="Sign in"
class="radius button"/>
</div>
</div>
</form>
this is the error I get:
File
"/Users/Shared/webapp/deformport_env/lib/python2.7/site-packages/deform-2.0a2-py2.7.egg/deform/field.py",
line 267, in __getitem__
raise KeyError(name)
KeyError: 'checked_password'
and here is some debugging information:
(Pdb) p reset_form
<deform.form.Form object at 4535358992 (schemanode '')>
(Pdb) p reset_form.schema
<deformport.deform.schemas.ResetAccountSchema object at 4535358480 (named )>
(Pdb) p reset_form.field()
*** AttributeError: AttributeError("'Form' object has no attribute
'field'",)
(Pdb) p reset_form.render()
u'<form\n id="deform"\n method="POST"\n enctype="multipart/form-data"\n
accept-charset="utf-8" class="deform"\n >\n\n <fieldset
class="deformFormFieldset">\n\n \n\n <input type="hidden"
name="_charset_" />\n <input type="hidden" name="__formid__"
value="deform"/>\n\n \n\n \n\n \n\n <div class="form-group">\n
\n </div>\n\n </fieldset>\n\n \n\n</form>\n'
any idea what I'm missing?
Michael
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/d/optout.