diff -r 01d85f3a3d9e -r bf5cbc351e99 hooks/metadata.py --- a/hooks/metadata.py Tue Mar 30 10:20:03 2010 +0200 +++ b/hooks/metadata.py Tue Mar 30 10:28:41 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):