2017-05-05 113 views
2

我有一个敏捷内容类型在Employee.xml中定义为模型。plone中plone敏捷内容类型的内容迁移5

<model xmlns="http://namespaces.plone.org/supermodel/schema" 
    xmlns:marshal="http://namespaces.plone.org/supermodel/marshal" 
    xmlns:i18n="http://xml.zope.org/namespaces/i18n" 
    i18n:domain="plone"> 
    <schema> 
    <field name="fullname" type="zope.schema.TextLine"> 
     <description /> 
     <required>True</required> 
     <title>Firstname and Surname</title> 
    </field> 
    <field name="position" type="zope.schema.TextLine"> 
     <description /> 
     <required>True</required> 
     <title>Position</title> 
    </field> 
    </schema> 
</model> 

很简单。该类在content.py中定义。

class Employee(Item): 
    """Convenience subclass for ``Employee`` portal type 
    """ 

在我的数据库中有Employee的一些实例。

现在我想为我的内容类型添加一个新功能。

class Employee(Item): 
    """Convenience subclass for ``Employee`` portal type 
    """ 

    def Title(self): 
     return self.fullname 

现在我可以在folder_contents视图中看到员工的全名。但它仅适用于修改后添加的实例。 “旧”内容似乎需要迁移。 我的问题:如何? 文档没有帮助。 (https://docs.plone.org/develop/plone/persistency/migrations.html

+0

问题发布到我们的论坛https://community.plone.org将获得更多的意见... –

回答

4

较旧的实例尚未重新编制索引,因此基于目录(集合,导航,搜索,文件夹内容等)的所有内容都无法识别其新的Title属性。

刚刚重新编译你的portal_catalog,它会没事的。

相关问题