[wf] allow ascii state/transition names 3.5
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 21 Aug 2009 08:43:28 +0200
branch3.5
changeset 2945 f0ab83510477
parent 2944 3bd49b70f7f9
child 2946 957fd4b276e2
[wf] allow ascii state/transition names
entities/wfobjs.py
--- a/entities/wfobjs.py	Fri Aug 21 08:43:00 2009 +0200
+++ b/entities/wfobjs.py	Fri Aug 21 08:43:28 2009 +0200
@@ -80,7 +80,7 @@
         """method to ease workflow definition: add a state for one or more
         entity type(s)
         """
-        state = self.req.create_entity('State', name=name, **kwargs)
+        state = self.req.create_entity('State', name=unicode(name), **kwargs)
         self.req.execute('SET S state_of WF WHERE S eid %(s)s, WF eid %(wf)s',
                          {'s': state.eid, 'wf': self.eid}, ('s', 'wf'))
         if initial:
@@ -95,7 +95,7 @@
         """method to ease workflow definition: add a transition for one or more
         entity type(s), from one or more state and to a single state
         """
-        tr = self.req.create_entity('Transition', name=name, **kwargs)
+        tr = self.req.create_entity('Transition', name=unicode(name), **kwargs)
         self.req.execute('SET T transition_of WF '
                          'WHERE T eid %(t)s, WF eid %(wf)s',
                          {'t': tr.eid, 'wf': self.eid}, ('t', 'wf'))