hooks/metadata.py
branchstable
changeset 4825 cdd979ae1b57
parent 4811 6c3d5f2a4e01
child 4835 13b0b96d7982
equal deleted inserted replaced
4824:b01973eff0f7 4825:cdd979ae1b57
    19     # eschema.eid is None if schema has been readen from the filesystem, not
    19     # eschema.eid is None if schema has been readen from the filesystem, not
    20     # from the database (eg during tests)
    20     # from the database (eg during tests)
    21     if eschema.eid is None:
    21     if eschema.eid is None:
    22         eschema.eid = session.unsafe_execute(
    22         eschema.eid = session.unsafe_execute(
    23             'Any X WHERE X is CWEType, X name %(name)s',
    23             'Any X WHERE X is CWEType, X name %(name)s',
    24             {'name': str(etype)})[0][0]
    24             {'name': str(eschema)})[0][0]
    25     return eschema.eid
    25     return eschema.eid
    26 
    26 
    27 
    27 
    28 class MetaDataHook(hook.Hook):
    28 class MetaDataHook(hook.Hook):
    29     __abstract__ = True
    29     __abstract__ = True