私は、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)
私たちのフォーラムhttps://community.plone.orgに投稿した質問は、より多くの意見を得るでしょう... –