22ceeafc3d304b46e00e4ce324bfb6f273a0e05a
[zzz-floof.git] / floof / model / __init__.py
1 #
2 # floof/floof/model/__init__.py
3 #
4 # Copyright (c) 2009 Scribblr
5 #
6 # See: http://bel-epa.com/docs/elixir_pylons/
7 #
8
9 """The application's model objects"""
10
11 from floof.model import art, users
12 from floof.model import meta
13 import elixir
14
15 elixir.session = meta.Session
16 Session = elixir.session
17 elixir.options_defaults.update({ 'autoload': True, 'shortnames': True })
18
19 metadata = elixir.metadata
20
21 def init_model(engine):
22 elixir.session.configure(bind=engine)
23 metadata.bind = engine
24
25 if elixir.options_defaults.get('autoload', False):
26 if not metadata.is_bound():
27 elixir.delay_setup = True
28 else:
29 elixir.setup_all(True)
30