oops, this method doesn't belong anymore to entity class tls-sprint
authorsylvain.thenault@logilab.fr
Fri, 27 Mar 2009 17:10:11 +0100
branchtls-sprint
changeset 1184 a33deae7c6a2
parent 1183 62afd820d3ae
child 1185 ffe1b6f495e8
oops, this method doesn't belong anymore to entity class
web/form.py
--- a/web/form.py	Fri Mar 27 17:09:43 2009 +0100
+++ b/web/form.py	Fri Mar 27 17:10:11 2009 +0100
@@ -561,15 +561,16 @@
         relation's object entities (i.e. self is the subject) according
         to initial_state, state_of and next_state relation
         """
-        if not self.has_eid() or not self.in_state:
+        entity = self.edited_entity
+        if not entity.has_eid() or not entity.in_state:
             # get the initial state
             rql = 'Any S where S state_of ET, ET name %(etype)s, ET initial_state S'
-            rset = self.req.execute(rql, {'etype': str(self.e_schema)})
+            rset = self.req.execute(rql, {'etype': str(entity.e_schema)})
             if rset:
                 return [(rset.get_entity(0, 0).view('combobox'), rset[0][0])]
             return []
         results = []
-        for tr in self.in_state[0].transitions(self):
+        for tr in entity.in_state[0].transitions(entity):
             state = tr.destination_state[0]
             results.append((state.view('combobox'), state.eid))
         return sorted(results)