server/test/data/migrschema/Folder2.py
author Sylvain <syt@logilab.fr>
Wed, 14 Jan 2009 17:16:15 +0100
changeset 411 c3d08d95693b
parent 0 b97547f5f1fa
child 1802 d628defebc17
permissions -rw-r--r--
Added tag cubicweb-debian-version-3_0_2-1 for changeset 18d3e56c1de4

from cubicweb.schema import format_constraint

class Folder2(MetaUserEntityType):
    """folders are used to classify entities. They may be defined as a tree.
    When you include the Folder entity, all application specific entities
    may then be classified using the "filed_under" relation.
    """
    name = String(required=True, indexed=True, internationalizable=True,
                  constraints=[UniqueConstraint(), SizeConstraint(64)])
    description_format = String(meta=True, internationalizable=True,
                                default='text/rest', constraints=[format_constraint])
    description = String(fulltextindexed=True)

    filed_under2 = BothWayRelation(
        SubjectRelation('Folder2', description=_("parent folder")),
        ObjectRelation('*'),
        )


class filed_under2(MetaUserRelationType):
    """indicates that an entity is classified under a folder"""
    # is_about has been renamed into filed_under
    #//* is_about Folder
    #* filed_under Folder