schemas/bootstrap.py
changeset 2485 ae74b46ea96c
parent 2476 1294a6bdf3bf
child 3392 36bcf206e157
child 3877 7ca53fc72a0a
child 4212 ab6573088b4a
equal deleted inserted replaced
2484:7e9283731db8 2485:ae74b46ea96c
     1 """core CubicWeb schema necessary for bootstrapping the actual application's schema
     1 """core CubicWeb schema necessary for bootstrapping the actual instance's schema
     2 
     2 
     3 :organization: Logilab
     3 :organization: Logilab
     4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
     4 :copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2.
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     5 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
    14 from cubicweb.schemas import META_ETYPE_PERMS, META_RTYPE_PERMS
    14 from cubicweb.schemas import META_ETYPE_PERMS, META_RTYPE_PERMS
    15 
    15 
    16 # not restricted since as "is" is handled as other relations, guests need
    16 # not restricted since as "is" is handled as other relations, guests need
    17 # access to this
    17 # access to this
    18 class CWEType(EntityType):
    18 class CWEType(EntityType):
    19     """define an entity type, used to build the application schema"""
    19     """define an entity type, used to build the instance schema"""
    20     permissions = META_ETYPE_PERMS
    20     permissions = META_ETYPE_PERMS
    21     name = String(required=True, indexed=True, internationalizable=True,
    21     name = String(required=True, indexed=True, internationalizable=True,
    22                   unique=True, maxsize=64)
    22                   unique=True, maxsize=64)
    23     description = RichString(internationalizable=True,
    23     description = RichString(internationalizable=True,
    24                              description=_('semantic description of this entity type'))
    24                              description=_('semantic description of this entity type'))
    25     # necessary to filter using RQL
    25     # necessary to filter using RQL
    26     final = Boolean(description=_('automatic'))
    26     final = Boolean(description=_('automatic'))
    27 
    27 
    28 
    28 
    29 class CWRType(EntityType):
    29 class CWRType(EntityType):
    30     """define a relation type, used to build the application schema"""
    30     """define a relation type, used to build the instance schema"""
    31     permissions = META_ETYPE_PERMS
    31     permissions = META_ETYPE_PERMS
    32     name = String(required=True, indexed=True, internationalizable=True,
    32     name = String(required=True, indexed=True, internationalizable=True,
    33                   unique=True, maxsize=64)
    33                   unique=True, maxsize=64)
    34     description = RichString(internationalizable=True,
    34     description = RichString(internationalizable=True,
    35                              description=_('semantic description of this relation type'))
    35                              description=_('semantic description of this relation type'))
    44 
    44 
    45 class CWAttribute(EntityType):
    45 class CWAttribute(EntityType):
    46     """define a final relation: link a final relation type from a non final
    46     """define a final relation: link a final relation type from a non final
    47     entity to a final entity type.
    47     entity to a final entity type.
    48 
    48 
    49     used to build the application schema
    49     used to build the instance schema
    50     """
    50     """
    51     permissions = META_ETYPE_PERMS
    51     permissions = META_ETYPE_PERMS
    52     relation_type = SubjectRelation('CWRType', cardinality='1*',
    52     relation_type = SubjectRelation('CWRType', cardinality='1*',
    53                                     constraints=[RQLConstraint('O final TRUE')],
    53                                     constraints=[RQLConstraint('O final TRUE')],
    54                                     composite='object')
    54                                     composite='object')
    81 
    81 
    82 class CWRelation(EntityType):
    82 class CWRelation(EntityType):
    83     """define a non final relation: link a non final relation type from a non
    83     """define a non final relation: link a non final relation type from a non
    84     final entity to a non final entity type.
    84     final entity to a non final entity type.
    85 
    85 
    86     used to build the application schema
    86     used to build the instance schema
    87     """
    87     """
    88     permissions = META_ETYPE_PERMS
    88     permissions = META_ETYPE_PERMS
    89     relation_type = SubjectRelation('CWRType', cardinality='1*',
    89     relation_type = SubjectRelation('CWRType', cardinality='1*',
    90                                     constraints=[RQLConstraint('O final FALSE')],
    90                                     constraints=[RQLConstraint('O final FALSE')],
    91                                     composite='object')
    91                                     composite='object')