server/hookhelper.py
changeset 2647 b0a2e779845c
parent 2609 a0f6fa90cc32
child 2840 06daf13195d4
child 2876 b6993462ddb9
--- a/server/hookhelper.py	Sun Aug 02 11:58:55 2009 +0200
+++ b/server/hookhelper.py	Sun Aug 02 12:00:17 2009 +0200
@@ -17,9 +17,7 @@
 
 def entity_attr(session, eid, attr):
     """return an arbitrary attribute of the entity with the given eid"""
-    rset = session.execute('Any N WHERE X eid %%(x)s, X %s N' % attr,
-                           {'x': eid}, 'x')
-    return rset[0][0]
+    return getattr(session.entity_from_eid(eid), attr)
 
 def rproperty(session, rtype, eidfrom, eidto, rprop):
     rschema = session.repo.schema[rtype]