2017-05-05 11 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

Google 포럼 https://community.plone.org에 게시하는 질문은 더 많은 의견을 얻을 것입니다 ... –

답변

4

이전 인스턴스는 다시 색인화되지 않았으므로 카탈로그 (모음, 탐색, 검색, 폴더 내용 등)를 기반으로하는 모든 것이 새 Title 속성을 인식 할 수 없습니다.

portal_catalog를 다시 색인하면 정상입니다.