hooks/metadata.py
changeset 5082 d6fd82a5a4e8
parent 5066 bf5cbc351e99
child 5174 78438ad513ca
child 5421 8167de96c523
--- a/hooks/metadata.py	Fri Mar 26 19:21:17 2010 +0100
+++ b/hooks/metadata.py	Tue Mar 30 14:32:03 2010 +0200
@@ -12,17 +12,7 @@
 
 from cubicweb.selectors import implements
 from cubicweb.server import hook
-
-
-def eschema_eid(session, eschema):
-    """get eid of the CWEType entity for the given yams type"""
-    # eschema.eid is None if schema has been readen from the filesystem, not
-    # from the database (eg during tests)
-    if eschema.eid is None:
-        eschema.eid = session.execute(
-            'Any X WHERE X is CWEType, X name %(name)s',
-            {'name': str(eschema)})[0][0]
-    return eschema.eid
+from cubicweb.server.utils import eschema_eid
 
 
 class MetaDataHook(hook.Hook):