schemas/base.py
changeset 6944 0cf10429ad39
parent 6942 18bdddd3740f
child 6957 ffda12be2e9f
equal deleted inserted replaced
6943:406a41c25e13 6944:0cf10429ad39
   305     subject = '*'
   305     subject = '*'
   306     object = 'CWSource'
   306     object = 'CWSource'
   307     cardinality = '1*'
   307     cardinality = '1*'
   308     composite = 'object'
   308     composite = 'object'
   309 
   309 
   310 class cw_support(RelationDefinition):
   310 class CWSourceSchemaConfig(EntityType):
   311     subject = 'CWSource'
   311     __permissions__ = ENTITY_MANAGERS_PERMISSIONS
   312     object = ('CWEType', 'CWRType')
   312     __unique_together__ = [('cw_for_source', 'cw_schema')]
   313     constraints = [RQLConstraint('NOT O final TRUE')]
   313     cw_for_source = SubjectRelation(
   314 
   314         'CWSource', inlined=True, cardinality='1*', composite='object',
   315 class cw_dont_cross(RelationDefinition):
   315         __permissions__=RELATION_MANAGERS_PERMISSIONS)
   316     subject = 'CWSource'
   316     cw_schema = SubjectRelation(
   317     object = 'CWRType'
   317         ('CWEType', 'CWRType', 'CWAttribute', 'CWRelation'),
   318     constraints = [RQLConstraint('NOT O final TRUE'),
   318         inlined=True, cardinality='1*', composite='object',
   319                    RQLConstraint('NOT S cw_may_cross O')]
   319         __permissions__=RELATION_MANAGERS_PERMISSIONS)
   320 
   320     options = String(description=_('allowed options depends on the source type'))
   321 class cw_may_cross(RelationDefinition):
   321 
   322     subject = 'CWSource'
       
   323     object = 'CWRType'
       
   324     constraints = [RQLConstraint('NOT O final TRUE'),
       
   325                    RQLConstraint('NOT S cw_dont_cross O')]
       
   326 
   322 
   327 # "abtract" relation types, no definition in cubicweb itself ###################
   323 # "abtract" relation types, no definition in cubicweb itself ###################
   328 
   324 
   329 class identical_to(RelationType):
   325 class identical_to(RelationType):
   330     """identical to"""
   326     """identical to"""