[schema] cleanup
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 23 Apr 2010 08:48:42 +0200
changeset 5378 0f54a0e128ac
parent 5374 9732efc9d599
child 5379 c082dea0731b
[schema] cleanup
schema.py
--- a/schema.py	Thu Apr 22 17:20:08 2010 +0200
+++ b/schema.py	Fri Apr 23 08:48:42 2010 +0200
@@ -615,13 +615,13 @@
         # start with a comma for bw compat, see below
         return ';' + self.mainvars + ';' + self.restriction
 
+    @classmethod
     def deserialize(cls, value):
         # XXX < 3.5.10 bw compat
         if not value.startswith(';'):
             return cls(value)
         _, mainvars, restriction = value.split(';', 2)
         return cls(restriction, mainvars)
-    deserialize = classmethod(deserialize)
 
     def check(self, entity, rtype, value):
         """return true if the value satisfy the constraint, else false"""
@@ -971,8 +971,8 @@
 
 class workflowable_definition(ybo.metadefinition):
     """extends default EntityType's metaclass to add workflow relations
-    (i.e. in_state and wf_info_for).
-    This is the default metaclass for WorkflowableEntityType
+    (i.e. in_state, wf_info_for and custom_workflow). This is the default
+    metaclass for WorkflowableEntityType.
     """
     def __new__(mcs, name, bases, classdict):
         abstract = classdict.pop('__abstract__', False)
@@ -983,6 +983,9 @@
         return cls
 
 def make_workflowable(cls, in_state_descr=None):
+    """Adds workflow relations as :class:`WorkflowableEntityType`, but usable on
+    existing classes which are not using that base class.
+    """
     existing_rels = set(rdef.name for rdef in cls.__relations__)
     # let relation types defined in cw.schemas.workflow carrying
     # cardinality, constraints and other relation definition properties