Shabti / shabti / templates / auth / +package+ / model / __init__.py_tmpl

"""The application's model objects"""
{{if sqlalchemy}}
import elixir
from {{package}}.model import meta

Session = elixir.session = meta.Session
# Uncomment if using reflected tables
# elixir.options_defaults.update({'autoload': True})
metadata = elixir.metadata

# this will be called in config/
# if not using reflected tables
def init_model(engine):
    """Call me before using any of the tables or classes in the model"""
    metadata.bind = engine

# Delay the setup if using reflected tables
if elixir.options_defaults.get('autoload', False) \
    and not metadata.is_bound():
    elixir.delay_setup = True

# Import model entities here for convenience of referring to 
# them as model.User, model.Group, etc.

from identity import *

# Finally, call elixir to set up the tables.
# but not if using reflected tables
if not elixir.options_defaults.get('autoload', False):

# --- Overwritten by Shabti auth template