schemas/workflow.py
branch3.5
changeset 2943 77622caef9bd
parent 2939 a613cc003ab7
child 2950 643570a7770f
--- a/schemas/workflow.py	Fri Aug 21 08:31:25 2009 +0200
+++ b/schemas/workflow.py	Fri Aug 21 08:42:17 2009 +0200
@@ -26,16 +26,22 @@
                                   description=_('entity types which may use this workflow'),
                                   constraints=[RQLConstraint('O final FALSE')])
 
-    default_workflow_of = SubjectRelation('CWEType', cardinality='*?',
-                                          description=_('which entity types use this workflow by default'),
-                                          constraints=[RQLConstraint('O final FALSE')])
-
     initial_state = SubjectRelation('State', cardinality='?*',
                                    # S initial_state O, O state_of S
                                    constraints=[RQLConstraint('O state_of S')],
                                    description=_('initial state for this workflow'))
 
 
+class default_workflow(RelationType):
+    """default workflow for this entity types"""
+    permissions = META_RTYPE_PERMS
+
+    subject = 'CWEType'
+    object = 'Workflow'
+    cardinality = '?*'
+    constraints = [RQLConstraint('S final FALSE, O workflow_of S')]
+
+
 class State(EntityType):
     """used to associate simple states to an entity type and/or to define
     workflows