cubicweb/server/test/data-migractions/migratedapp/cubicweb_tag/schema.py
author Denis Laxalde <denis.laxalde@logilab.fr>
Wed, 24 Jul 2019 16:52:00 +0200
changeset 12711 9d72e299309e
parent 12515 cubicweb/server/test/data/cubicweb_tag/schema.py@2d43c8b30ef0
permissions -rw-r--r--
[test] Replace symlinks by real copies This solves a "python setup.py build" issue.

from yams.buildobjs import EntityType, String, SubjectRelation, RelationType


class Tag(EntityType):
    """tags are used by users to mark entities.
    When you include the Tag entity, all application specific entities
    may then be tagged using the "tags" relation.
    """
    name = String(required=True, fulltextindexed=True, unique=True,
                  maxsize=128)
    # when using this component, add the Tag tag X relation for each type that
    # should be taggeable
    tags = SubjectRelation('Tag', description="tagged objects")


class tags(RelationType):
    """indicates that an entity is classified by a given tag"""