selectors.py
branchstable
changeset 7298 a448e470c150
parent 7297 117dbb11a42e
child 7345 b9eaad6e34c3
equal deleted inserted replaced
7297:117dbb11a42e 7298:a448e470c150
  1242     transition details (including the entity to which is applied the transition
  1242     transition details (including the entity to which is applied the transition
  1243     but also its original state, transition, destination state, user...).  See
  1243     but also its original state, transition, destination state, user...).  See
  1244     :class:`cubicweb.entities.wfobjs.TrInfo` for more information.
  1244     :class:`cubicweb.entities.wfobjs.TrInfo` for more information.
  1245     """
  1245     """
  1246     def match_etype_and_transition(trinfo):
  1246     def match_etype_and_transition(trinfo):
  1247         # is_instance() first two arguments are 'cls' (unused, so giving None is
  1247         # take care trinfo.transition is None when calling change_state
  1248         # fine) and the request/session
  1248         return (trinfo.transition and trinfo.transition.name == tr_name
  1249         return (trinfo.transition.name == tr_name
  1249                 # is_instance() first two arguments are 'cls' (unused, so giving
       
  1250                 # None is fine) and the request/session
  1250                 and is_instance(etype)(None, trinfo._cw, entity=trinfo.for_entity))
  1251                 and is_instance(etype)(None, trinfo._cw, entity=trinfo.for_entity))
  1251 
  1252 
  1252     return is_instance('TrInfo') & score_entity(match_etype_and_transition)
  1253     return is_instance('TrInfo') & score_entity(match_etype_and_transition)
  1253 
  1254 
  1254 
  1255