Skip to content
Snippets Groups Projects
schema.py 880 B
Newer Older
from yams.buildobjs import EntityType, RelationDefinition, String
from cubicweb.schema import WorkflowableEntityType

# Worklowable entity type to check the container structure ignores
# workflow-related rtypes.
class Agent(WorkflowableEntityType):
    """An agent (eg. person, group, software or physical artifact)."""
    name = String()


class knows(RelationDefinition):
    subject = 'Agent'
    object = 'Agent'
    symmetric = True


class OnlineAccount(EntityType):
    """An online account"""


class account(RelationDefinition):
    """Indicates an account held by an agent"""
    subject = 'Agent'
    object = 'OnlineAccount'
    cardinality = '*1'
    composite = 'subject'


class Group(EntityType):
    """A collection of individual agents"""


class member(RelationDefinition):
    """Indicates a member of a Group."""
    subject = 'Group'
    object = 'Agent'