9cacd1888526dba5b3b1d3f54365c48c63bd136a
1 """The application's model objects"""
3 from floof
.model
import meta
5 Session
= elixir
.session
= meta
.Session
6 # Uncomment if using reflected tables
7 # elixir.options_defaults.update({'autoload': True})
8 elixir
.options_defaults
.update({'shortnames':True})
9 metadata
= elixir
.metadata
11 # this will be called in config/environment.py
12 # if not using reflected tables
13 def init_model(engine
):
14 """Call me before using any of the tables or classes in the model"""
15 meta
.Session
.configure(bind
=engine
)
16 metadata
.bind
= engine
18 # Delay the setup if using reflected tables
19 if elixir
.options_defaults
.get('autoload', False) \
20 and not metadata
.is_bound():
21 elixir
.delay_setup
= True
23 # # import other entities here, e.g.
24 # from floof.model.blog import BlogEntry, BlogComment
25 from floof
.model
.art
import Art
26 from floof
.model
.users
import User
, IdentityURL
28 # Finally, call elixir to set up the tables.
29 # but not if using reflected tables
30 if not elixir
.options_defaults
.get('autoload', False):