[schema] rephrase relation definition since constraint doesn't apply to CWRelation
--- a/schemas/base.py Tue Jul 26 11:01:17 2011 +0200
+++ b/schemas/base.py Tue Jul 26 11:21:26 2011 +0200
@@ -323,14 +323,28 @@
cw_for_source = SubjectRelation(
'CWSource', inlined=True, cardinality='1*', composite='object',
__permissions__=RELATION_MANAGERS_PERMISSIONS)
- cw_schema = SubjectRelation(
- ('CWEType', 'CWRType', 'CWRelation'),
- inlined=True, cardinality='1*', composite='object',
- constraints=[RQLConstraint('NOT O final TRUE')],
- __permissions__=RELATION_MANAGERS_PERMISSIONS)
options = String(description=_('allowed options depends on the source type'))
+class rtype_cw_schema(RelationDefinition):
+ __permissions__ = RELATION_MANAGERS_PERMISSIONS
+ name = 'cw_schema'
+ subject = 'CWSourceSchemaConfig'
+ object = ('CWEType', 'CWRType')
+ inlined = True
+ cardinality = '1*'
+ composite = 'object'
+ constraints = [RQLConstraint('NOT O final TRUE')]
+
+class rdef_cw_schema(RelationDefinition):
+ __permissions__ = RELATION_MANAGERS_PERMISSIONS
+ name = 'cw_schema'
+ subject = 'CWSourceSchemaConfig'
+ object = 'CWRelation'
+ inlined = True
+ cardinality = '1*'
+ composite = 'object'
+
# "abtract" relation types, no definition in cubicweb itself ###################
class identical_to(RelationType):