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 *
26 from floof
.model
.ratings
import *
27 from floof
.model
.comments
import *
28 from floof
.model
.search
import *
29 from floof
.model
.tags
import *
30 from floof
.model
.users
import *
33 # Finally, call elixir to set up the tables.
34 # but not if using reflected tables
35 if not elixir
.options_defaults
.get('autoload', False):