7caeed02bc9b6aab953949e81e0696cbb3ebcd3a
[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 identity_url = IdentityURL(url=u'http://eevee.livejournal.com/')
22 user = User(name=u'Eevee')
23 user.identity_urls.append(identity_url)
24
25
26 # some_entity = model.Session.query(model.<modelfile>.<Some_Entity>).get(1)
27 # e.g. foo = model.Session.query(model.identity.User).get(1)
28 # from datetime import datetime
29 # some_entity.poked_on = datetime.now()
30 # model.Session.add(some_entity)
31 model.Session.commit()