2013-05-13 55 views
0

這是從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') 

任何想法將不勝感激!

+1

追蹤只是意味着成員信息'dict'中沒有'位置'鍵。 – 2013-05-13 08:27:25

回答

2

好的FYI其他人遇到這種情況,我進入ZMI,進入portal_memberdata,然後將一些文本添加到由我的插件創建的位置字段中。單擊保存後,我可以看到/ @@個人信息表格,我現在可以根據每個用戶進行更新。