Added parent property/links for comments, and a Return link on comment threads.
[zzz-floof.git] / floof / model / __init__.py
1 """The application's model objects"""
2 import elixir
3 from floof.model import meta
4
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
10
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
17
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
22
23 # # import other entities here, e.g.
24 # from floof.model.blog import BlogEntry, BlogComment
25 from floof.model import art, users, search
26
27 # Finally, call elixir to set up the tables.
28 # but not if using reflected tables
29 if not elixir.options_defaults.get('autoload', False):
30 elixir.setup_all()
31
32