schemas/bootstrap.py
branchstable
changeset 6208 07b176640a8c
parent 5782 8ff48d1a319f
child 6209 e3e5870807e9
equal deleted inserted replaced
6207:c3f11fadf9ed 6208:07b176640a8c
   152     __permissions__ = PUB_SYSTEM_ENTITY_PERMS
   152     __permissions__ = PUB_SYSTEM_ENTITY_PERMS
   153     cstrtype = SubjectRelation('CWConstraintType', cardinality='1*')
   153     cstrtype = SubjectRelation('CWConstraintType', cardinality='1*')
   154     value = String(description=_('depends on the constraint type'))
   154     value = String(description=_('depends on the constraint type'))
   155 
   155 
   156 
   156 
       
   157 class CWUniqueTogetherConstraint(EntityType):
       
   158     """defines a sql-level multicolumn unique index"""
       
   159     __permissions__ = PUB_SYSTEM_ENTITY_PERMS
       
   160     constraint_of = SubjectRelation('CWEType', cardinality='1*', composite='object',
       
   161 		   	            inlined=True)
       
   162     relations = SubjectRelation(('CWAttribute', 'CWRelation'), cardinality='+*',
       
   163                                  constraints=[RQLConstraint(
       
   164            'O from_entity X, S constraint_of X, O relation_type T, '
       
   165            'T final TRUE OR (T final FALSE AND T inlined TRUE)')])
       
   166 
       
   167 
   157 class CWConstraintType(EntityType):
   168 class CWConstraintType(EntityType):
   158     """define a schema constraint type"""
   169     """define a schema constraint type"""
   159     __permissions__ = PUB_SYSTEM_ENTITY_PERMS
   170     __permissions__ = PUB_SYSTEM_ENTITY_PERMS
   160     name = String(required=True, indexed=True, internationalizable=True,
   171     name = String(required=True, indexed=True, internationalizable=True,
   161                   unique=True, maxsize=64)
   172                   unique=True, maxsize=64)