2017-05-05 7 views
2

私は、Employee.xmlに機種として定義されている器用コンテンツタイプを持っています。plone 5のplone巧みなコンテンツタイプのコンテンツマイグレーション

<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を再インデックスするだけで問題ありません。

関連する問題