-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
SOLVED - one must call explictly bind() on the schema in this case.
Andreas
Andreas Jung wrote:
> Using Colander/Deform inside a Zope 2.11 using the following schema
> definition:
>
>
>
> import deform
> import colander
>
> @colander.deferred
> def selection_status(node, kw):
> values = kw.get('status', [])
> return deform.widget.SelectWidget(values=values)
>
> class DefaultSchema(colander.MappingSchema):
> anrede = colander.SchemaNode(
> colander.String(),
> title=u'Anrede',
> widget=selection_status,
> view_roles = ['Recherche', 'Anonymous', 'Authenticated',
> 'AutorenFiBu', 'AutorenHOA'],
> edit_roles = ['AutorenFiBu'],
> edit_roles_on_creation = ['AutorenRed', 'AutorenFiBu'],
> )
>
>
> Rendering the template fails:
>
> Traceback (innermost last):
>
> Module ZPublisher.Publish, line 126, in publish
> Module ZPublisher.mapply, line 88, in mapply
> Module ZPublisher.Publish, line 46, in call_object
> Module Shared.DC.Scripts.Bindings, line 316, in __call__
> Module Shared.DC.Scripts.Bindings, line 353, in _bindAndExec
> Module Products.CMFCore.FSPageTemplate, line 216, in _exec
> Module Products.CMFCore.FSPageTemplate, line 155, in pt_render
> Module Products.PageTemplates.PageTemplate, line 96, in pt_render
> Module zope.pagetemplate.pagetemplate, line 115, in pt_render
> Module zope.tal.talinterpreter, line 271, in __call__
> Module zope.tal.talinterpreter, line 346, in interpret
> Module zope.tal.talinterpreter, line 910, in do_useMacro
> Module zope.tal.talinterpreter, line 346, in interpret
> Module zope.tal.talinterpreter, line 539, in do_optTag_tal
> Module zope.tal.talinterpreter, line 524, in do_optTag
> Module zope.tal.talinterpreter, line 519, in no_tag
> Module zope.tal.talinterpreter, line 346, in interpret
> Module zope.tal.talinterpreter, line 968, in do_defineSlot
> Module zope.tal.talinterpreter, line 346, in interpret
> Module zope.tal.talinterpreter, line 764, in do_insertStructure_tal
> Module Products.PageTemplates.Expressions, line 223, in evaluateStructure
> Module zope.tales.tales, line 696, in evaluate
> URL:
> file:/local/HRS2/Devel/junga/hrs_trunk/parts/products-svn/AutorenDB2/skins/autorendb2/deform.xpt
> Line 17, Column 8
> Expression:
> Names:
> {'container': ,
> 'context': ,
> 'default': ,
> 'here': ,
> 'loop': {},
> 'nothing': None,
> 'options': {'args': ()},
> 'repeat': 0x2aaab04224d0>,
> 'request': http://hdev:8080/Test/adb/deform>,
> 'root': ,
> 'template': ,
> 'user': }
> Module zope.tales.expressions, line 217, in __call__
> Module Products.PageTemplates.Expressions, line 163, in _eval
> Module Products.PageTemplates.Expressions, line 115, in render
> Module Products.PageTemplates.ZRPythonExpr, line 79, in call_with_ns
> Module Products.CMFCore.FSPythonScript, line 135, in
> __render_with_namespace__
> Module Shared.DC.Scripts.Bindings, line 330, in __render_with_namespace__
> Module Shared.DC.Scripts.Bindings, line 353, in _bindAndExec
> Module Products.CMFCore.FSPythonScript, line 196, in _exec
> Module None, line 25, in deform_prepare
>
> Line 25
> Module deform.field, line 419, in render
> Module deform.field, line 394, in serialize
> Module deform.widget, line 791, in serialize
> Module deform.template, line 103, in __call__
> Module chameleon.core.template, line 103, in __call__
> Module chameleon.core.template, line 394, in render
> Module chameleon.zpt.template, line 17, in render
> Module chameleon.core.template, line 221, in render
> Module chameleon.core.template, line 373, in cook_and_render
> Module chameleon.core.template, line 209, in cook_and_render
> __traceback_info__: ( /local/HRS2/Devel/junga/hrs_trunk/eggs/deform-0.8-py2.4.egg/deform/templates/form.pt>,)
> Module chameleon_53e47ea76efd9f4bb68ebdb1440a64e2d2819387, line 307, in
> render
> Module deform.template, line 103, in __call__
> Module chameleon.core.template, line 103, in __call__
> Module chameleon.core.template, line 394, in render
> Module chameleon.zpt.template, line 17, in render
> Module chameleon.core.template, line 221, in render
> Module chameleon.core.template, line 373, in cook_and_render
> Module chameleon.core.template, line 209, in cook_and_render
> __traceback_info__: ( /local/HRS2/Devel/junga/hrs_trunk/eggs/deform-0.8-py2.4.egg/deform/templates/mapping_item.pt>,)
> Module chameleon_9a2a51e2a4e74828462e65a50a39b7df03fa54a4, line 213, in
> render
> Module deform.field, line 394, in serialize
> Module deform.widget, line 791, in serialize
> Module deform.template, line 103, in __call__
> Module chameleon.core.template, line 103, in __call__
> Module chameleon.core.template, line 394, in render
> Module chameleon.zpt.template, line 17, in render
> Module chameleon.core.template, line 221, in render
> Module chameleon.core.template, line 373, in cook_and_render
> Module chameleon.core.template, line 209, in cook_and_render
> __traceback_info__: (