collective.data.examples自定义字段不会保存数据
问题描述:
这是从this question延续。 我已经使用collective.examples.userdata 并成功地将“定位”文本字段添加到我的用户注册表单中。我的问题是,当我进入我的/ @@个人信息页面时,请填写该字段并点击“保存”,它会再次显示该字段,并且该字段为空。我似乎无法将任何信息保存到此字段。我尝试在前台模式下运行实例,但在尝试保存新信息时看不到任何输出。collective.data.examples自定义字段不会保存数据
我不知道这是否会帮助,但是当我尝试使用以下TALES声明:
tal:define="membership context/portal_membership;
info python:membership.getMemberInfo(user.getId());"
然后:
tal:replace="info/position"
我得到以下回溯:
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PageTemplates.ZopePageTemplate, line 334, in _exec
Module Products.PageTemplates.ZopePageTemplate, line 431, in pt_render
Module Products.PageTemplates.PageTemplate, line 79, in pt_render
Module zope.pagetemplate.pagetemplate, line 113, in pt_render
Module zope.tal.talinterpreter, line 271, in __call__
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 888, in do_useMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 858, in do_defineMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 954, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 946, in do_defineSlot
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 858, in do_defineMacro
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 533, in do_optTag_tal
Module zope.tal.talinterpreter, line 518, in do_optTag
Module zope.tal.talinterpreter, line 513, in no_tag
Module zope.tal.talinterpreter, line 343, in interpret
Module zope.tal.talinterpreter, line 620, in do_insertText_tal
Module Products.PageTemplates.Expressions, line 225, in evaluateText
Module zope.tales.tales, line 696, in evaluate
- URL: /mysite/portal_skins/custom/home_page_view
- Line 32, Column 11
- Expression: <PathExpr standard:u'info/position'>
- Names:
{'container': <PloneSite at /mysite>,
'context': <ATDocument at /mysite/front-page>,
'default': <object object at 0x7f1c681eeb30>,
'here': <ATDocument at /mysite/front-page>,
'loop': {},
'nothing': None,
'options': {'args':()},
'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0x9540260>,
'request': <HTTPRequest, URL=http://dan-apache:8080/mysite/front-page/home_page_view>,
'root': <Application at >,
'template': <ZopePageTemplate at /mysite/home_page_view used for /mysite/front-page>,
'traverse_subpath': [],
'user': <PropertiedUser 'dan'>}
Module zope.tales.expressions, line 217, in __call__
Module Products.PageTemplates.Expressions, line 147, in _eval
Module zope.tales.expressions, line 124, in _eval
Module Products.PageTemplates.Expressions, line 77, in boboAwareZopeTraverse
Module zope.traversing.adapters, line 136, in traversePathElement
- __traceback_info__: ({'language': '', 'description': '', 'username': 'dan', 'has_email': False, 'location': '', 'fullname': '', 'home_page': ''}, 'position')
Module zope.traversing.adapters, line 50, in traverse
- __traceback_info__: ({'language': '', 'description': '', 'username': 'dan', 'has_email': False, 'location': '', 'fullname': '', 'home_page': ''}, 'position', [])
LocationError: ({'language': '', 'description': '', 'username': 'dan', 'has_email': False, 'location': '', 'fullname': '', 'home_page': ''}, 'position')
任何想法将不胜感激!
答
好的FYI其他人遇到这种情况,我进入ZMI,进入portal_memberdata,然后将一些文本添加到由我的插件创建的位置字段中。单击保存后,我可以看到/ @@个人信息表格,我现在可以根据每个用户进行更新。
追踪只是意味着成员信息'dict'中没有'位置'键。 – 2013-05-13 08:27:25