update calls to a deprecated method stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Mon, 29 Jun 2009 17:02:51 +0200
branchstable
changeset 2195 58bef4f707ce
parent 2194 c8c8ef5c5c65
child 2196 b08521e4eaab
update calls to a deprecated method
server/hooks.py
server/schemahooks.py
sobjects/supervising.py
--- a/server/hooks.py	Mon Jun 29 16:18:07 2009 +0200
+++ b/server/hooks.py	Mon Jun 29 17:02:51 2009 +0200
@@ -85,16 +85,16 @@
     """
     ftcontainer = session.repo.schema.rschema(rtype).fulltext_container
     if ftcontainer == 'subject':
-        FTIndexEntityOp(session, entity=session.entity(eidto))
+        FTIndexEntityOp(session, entity=session.entity_from_eid(eidto))
     elif ftcontainer == 'object':
-        FTIndexEntityOp(session, entity=session.entity(eidfrom))
+        FTIndexEntityOp(session, entity=session.entity_from_eid(eidfrom))
 def fti_update_after_delete_relation(session, eidfrom, rtype, eidto):
     """sync fulltext index when relevant relation is deleted. Reindexing both
     entities is necessary.
     """
     if session.repo.schema.rschema(rtype).fulltext_container:
-        FTIndexEntityOp(session, entity=session.entity(eidto))
-        FTIndexEntityOp(session, entity=session.entity(eidfrom))
+        FTIndexEntityOp(session, entity=session.entity_from_eid(eidto))
+        FTIndexEntityOp(session, entity=session.entity_from_eid(eidfrom))
 
 class SyncOwnersOp(PreCommitOperation):
 
@@ -379,7 +379,7 @@
     etype = session.describe(fromeid)[0]
     if not (session.is_super_session or 'managers' in session.user.groups):
         if not state is None:
-            entity = session.entity(fromeid)
+            entity = session.entity_from_eid(fromeid)
             # we should find at least one transition going to this state
             try:
                 iter(state.transitions(entity, toeid)).next()
--- a/server/schemahooks.py	Mon Jun 29 16:18:07 2009 +0200
+++ b/server/schemahooks.py	Mon Jun 29 17:02:51 2009 +0200
@@ -38,7 +38,7 @@
 def get_constraints(session, entity):
     constraints = []
     for cstreid in session.transaction_data.get(entity.eid, ()):
-        cstrent = session.entity(cstreid)
+        cstrent = session.entity_from_eid(cstreid)
         cstr = CONSTRAINTS[cstrent.type].deserialize(cstrent.value)
         cstr.eid = cstreid
         constraints.append(cstr)
--- a/sobjects/supervising.py	Mon Jun 29 16:18:07 2009 +0200
+++ b/sobjects/supervising.py	Mon Jun 29 17:02:51 2009 +0200
@@ -48,7 +48,7 @@
     events = ('before_delete_entity',)
 
     def _call(self, eid):
-        entity = self.session.entity(eid)
+        entity = self.session.entity_from_eid(eid)
         try:
             title = entity.dc_title()
         except: