Comment posting support.
[zzz-floof.git] / floof / websetup.py
1 # -*- coding: utf-8 -*-
2 """Setup the floof application"""
3 import logging
4
5 from floof.config.environment import load_environment
6
7 log = logging.getLogger(__name__)
8
9 from pylons import config
10 from elixir import *
11 from floof import model as model
12
13 def setup_app(command, conf, vars):
14 """Place any commands to setup floof here"""
15 load_environment(conf.global_conf, conf.local_conf)
16 model.metadata.create_all()
17
18 # Initialisation here ... this sort of stuff:
19
20 # Users
21 from floof.model.users import IdentityURL, User
22 identity_url = IdentityURL(url=u'http://eevee.livejournal.com/')
23 user = User(name=u'Eevee')
24 user.identity_urls.append(identity_url)
25
26
27 # some_entity = model.Session.query(model.<modelfile>.<Some_Entity>).get(1)
28 # e.g. foo = model.Session.query(model.identity.User).get(1)
29 # from datetime import datetime
30 # some_entity.poked_on = datetime.now()
31 # model.Session.add(some_entity)
32 model.Session.commit()