diff -r 49075f57cf2c -r aa09e20dd8c0 entities/wfobjs.py --- a/entities/wfobjs.py Tue May 05 17:18:49 2009 +0200 +++ b/entities/wfobjs.py Thu May 14 12:48:11 2009 +0200 @@ -1,7 +1,7 @@ """workflow definition and history related entities :organization: Logilab -:copyright: 2001-2008 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved. :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr """ __docformat__ = "restructuredtext en" @@ -17,10 +17,7 @@ """ id = 'Transition' fetch_attrs, fetch_order = fetch_config(['name']) - __rtags__ = {('destination_state', '*', 'subject'): 'create', - ('allowed_transition', '*', 'object') : 'create', - } - + def may_be_passed(self, eid, stateeid): """return true if the logged user may pass this transition @@ -47,7 +44,7 @@ def destination(self): return self.destination_state[0] - + def after_deletion_path(self): """return (path, parameters) which should be used as redirect information when this entity is being deleted @@ -56,7 +53,7 @@ return self.transition_of[0].rest_path(), {'vid': 'workflow'} return super(Transition, self).after_deletion_path() - + class State(AnyEntity): """customized class for State entities @@ -66,11 +63,7 @@ id = 'State' fetch_attrs, fetch_order = fetch_config(['name']) rest_attr = 'eid' - - __rtags__ = {'destination_state' : 'create', - 'allowed_transition' : 'create' - } - + def transitions(self, entity, desteid=None): rql = ('Any T,N,DS where S allowed_transition T, S eid %(x)s, ' 'T name N, T destination_state DS, ' @@ -82,7 +75,7 @@ for tr in rset.entities(): if tr.may_be_passed(entity.eid, self.eid): yield tr - + def after_deletion_path(self): """return (path, parameters) which should be used as redirect information when this entity is being deleted @@ -91,7 +84,7 @@ return self.state_of[0].rest_path(), {'vid': 'workflow'} return super(State, self).after_deletion_path() - + class TrInfo(AnyEntity): """customized class for Transition information entities """ @@ -104,7 +97,7 @@ @property def previous_state(self): return self.from_state and self.from_state[0] - + @property def new_state(self): return self.to_state[0]