示例#1
0
def groupfinder(authorname, request):

  dbsession = DBSession()
  
  author = dbsession.query(Author).filter_by(author_name=authorname).first()
  
  groups = dbsession.query(AccessGroup).select_from(join(AuthorAccessGroupMap, AccessGroup, AuthorAccessGroupMap.group_id==AccessGroup.id)).filter(AuthorAccessGroupMap.author_id==author.id).all()

  return [group.group_name for group in groups]
  
示例#2
0
def initialize_sql(engine):
  DBSession.configure(bind=engine)
  mi_schema.Base.metadata.bind = engine
示例#3
0
def session_remove_callback(request):
  DBSession.remove()