1 # -*- coding: utf-8 -*-
2 """Setup the floof application"""
5 from floof
.config
.environment
import load_environment
7 log
= logging
.getLogger(__name__
)
9 from pylons
import config
11 from floof
import model
as model
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()
18 # Initialisation here ... this sort of stuff:
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
)
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()