diff -r c9dbd95333f7 -r d6fd82a5a4e8 hooks/metadata.py --- 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):