You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
509 B
Python
22 lines
509 B
Python
from sqlalchemy.orm import scoped_session, sessionmaker
|
|
import elixir
|
|
|
|
# replace the elixir session with our own
|
|
Session = scoped_session(sessionmaker(autoflush=True, transactional=True))
|
|
elixir.session = Session
|
|
elixir.options_defaults.update({
|
|
'shortnames': True
|
|
})
|
|
|
|
# use the elixir metadata
|
|
metadata = elixir.metadata
|
|
|
|
# this will be called in config/environment.py
|
|
def init_model(engine):
|
|
metadata.bind = engine
|
|
|
|
# import your entities, and set them up
|
|
from entities import *
|
|
elixir.setup_all()
|
|
|