"""The application's model objects"""
import elixir

from {{package}}.model import meta

# make Session available for use and
# store for later access

Session = elixir.session = meta.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):
    elixir.session.configure(bind=engine)
    metadata.bind = engine


# Unsure whether this is the right place. 
# Need to test it.

# Uncomment these lines if you want to use the 
# "autoload" option with your Elixir models
# if not metadata.is_bound():
#     elixir.delay_setup = True


# import other entities here, e.g.

from elixir_identity import *


# Finally, call elixir to set up the tables.

elixir.setup_all()


