-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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: <PathExpr standard:u'context/deform_prepare'>
Names:
{'container': <CMFSite at /Test/adb>,
 'context': <CMFSite at /Test/adb>,
 'default': <object object at 0x2b09bd94f200>,
 'here': <CMFSite at /Test/adb>,
 'loop': {},
 'nothing': None,
 'options': {'args': ()},
 'repeat': <Products.PageTemplates.Expressions.SafeMapping object at
0x2aaab04224d0>,
 'request': <HTTPRequest, URL=http://hdev:8080/Test/adb/deform>,
 'root': <Application at >,
 'template': <TrustedFSPageTemplate at /Test/adb/deform>,
 'user': <User 'ajung'>}
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
<TrustedFSPythonScript at /Test/adb/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__: (<PageTemplateFile
/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__: (<PageTemplateFile
/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__: (<PageTemplateFile
/local/HRS2/Devel/junga/hrs_trunk/eggs/deform-0.8-py2.4.egg/deform/templates/mapping.pt>,)
Module chameleon_4c7845e5d9fdd29e8b476d2bb96b0be5f0b7dfd8, line 182, 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__: (<PageTemplateFile
/local/HRS2/Devel/junga/hrs_trunk/eggs/deform-0.8-py2.4.egg/deform/templates/mapping_item.pt>,)
Module chameleon_9a2a51e2a4e74828462e65a50a39b7df03fa54a4, line 31, in
render
Module chameleon.core.codegen, line 35, in lookup_attr
RuntimeError: Caught exception rendering template. - Expression:
``rndr(tmpl,field=f,cstruct=cstruct.get(f.name, null))`` - Filename:
/local/HRS2/Devel/junga/hrs_trunk/eggs/deform-0.8-py2.4.egg/deform/templates/form.pt
- - Arguments: field: <Form - at 0x2aaab0445e90> cstruct: {...} (5)
template: <PageTemplateFile - at 0x2aaaafd69390> xincludes: <XIncludes -
at 0x2aaaafd69810> macros: <Macros - at 0x2aaaafe7b350> null: <_null -
at 0x2aaaafcce7d0> RuntimeError: Caught exception rendering template. -
Expression: ``field.serialize(cstruct)`` - Filename:
/local/HRS2/Devel/junga/hrs_trunk/eggs/deform-0.8-py2.4.egg/deform/templates/mapping_item.pt
- - Arguments: field: <Field - at 0x2aaab0452150> cstruct: {...} (27)
template: <PageTemplateFile - at 0x2aaaafe7b410> xincludes: <XIncludes -
at 0x2aaaafe7b590> macros: <Macros - at 0x2aaaafe7ba90> RuntimeError:
Caught exception rendering template. - Expression:
``rndr(tmpl,field=f,cstruct=cstruct.get(f.name,null))`` - Filename:
/local/HRS2/Devel/junga/hrs_trunk/eggs/deform-0.8-py2.4.egg/deform/templates/mapping.pt
- - Arguments: field: <Field - at 0x2aaab0452150> cstruct: {...} (27)
template: <PageTemplateFile - at 0x2aaaafe7ba50> xincludes: <XIncludes -
at 0x2aaaafe7be10> macros: <Macros - at 0x2aaaafe8b590> null: <_null -
at 0x2aaaafcce7d0> RuntimeError: Caught exception rendering template. -
Expression: ``field.widget.hidden`` - Filename:
/local/HRS2/Devel/junga/hrs_trunk/eggs/deform-0.8-py2.4.egg/deform/templates/mapping_item.pt
- - Arguments: field: <Field - at 0x2aaab0452f50> cstruct: <_null - at
0x2aaaafcce7d0> template: <PageTemplateFile - at 0x2aaaafe7b410>
xincludes: <XIncludes - at 0x2aaaafe7b590> macros: <Macros - at
0x2aaaafe7ba90> AttributeError: 'deferred' object has no attribute 'hidden'

Zope 2.11
Colander 0.9.1
deform 0.8
Chameleon 1.2.13

Anything I am missing?

Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJM/hD4AAoJEADcfz7u4AZj/lsLwL7+MUAuKoeduGB+5hnrdUC0
fvwuhQO9GAjIuaAGcVV6ipTrMbE7NiMq0b6LpDRPTbICIK0+IXzpQVn8iCeTXpYE
mBs4NiqPpf9ZAysNRIqrP5EMqCMwiI7M8p5IkWUtr9m8Wv2Aul/C64jHhOEt8Tc5
tMobMXuQ3couC6ZJ0ApfyRDywbGflTSVOZj2Z8x1zWf03DZze+A2h+NlW/dVcxj/
pST4TlapLQ5BYnGoZ9nVKeijSd6isaKx8oTaQkadTRSkmwS4TKPuxmnT3E/KZG4P
jQ7MfXiT+7gpRk8sA6CSRo2dn6lTXON8Fe1eBiI9vVSMr2KEwxz2+T/F39P9jI82
cT63KsgYM4h1AJJGPDKqFFbmS73UpT5yMVxJAThP74N4GwDWTr8X71EVBJbxW6jx
Rq2UhT1fswc83U2q8Vk0YY0y3OsYrROJkRZPb8BN1XZqP19KGVQdnH1Mg1tGUWAE
rzAQpvo/2qBtbSOm01i6wjNH7WLtnec=
=xxm6
-----END PGP SIGNATURE-----

<<attachment: lists.vcf>>

_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to