Exemplo n.º 1
0
    meta.Session.configure(bind=engine)
    meta.engine = engine
    assert engine is not None


## ---------------------------
## Annotation stuff

import annotator.model

annotation_table = annotator.model.make_annotation_table(meta.metadata)
Annotation = annotator.model.Annotation
annotator.model.map_annotation_object(mapper, annotation_table)
# Correct for fact we aren't using Session.mapper but annotator expects it
# http://www.sqlalchemy.org/trac/wiki/UsageRecipes/SessionAwareMapper
Annotation.query = Session.query_property()

## ---------------------------
## Our Classes

import uuid


def make_uuid():
    return unicode(uuid.uuid4())


# have to define this before its use in Work object
work_2_user_table = sa.Table(
    'work_2_user', meta.metadata,
    sa.Column('work_id',