X-Git-Url: http://git.veekun.com/zzz-floof.git/blobdiff_plain/5837da26db915faca89925c39fa83202bfb84e32..c03a740f65ea24ba6567b0ef75f3785faae37d42:/floof/websetup.py?ds=sidebyside diff --git a/floof/websetup.py b/floof/websetup.py index fa97149..7caeed0 100644 --- a/floof/websetup.py +++ b/floof/websetup.py @@ -1,25 +1,31 @@ +# -*- coding: utf-8 -*- """Setup the floof application""" -import elixir import logging from floof.config.environment import load_environment -from floof.model import meta -from floof.model.users import IdentityURL, User log = logging.getLogger(__name__) +from pylons import config +from elixir import * +from floof import model as model + def setup_app(command, conf, vars): """Place any commands to setup floof here""" load_environment(conf.global_conf, conf.local_conf) + model.metadata.create_all() - # Create the tables if they don't already exist - elixir.create_all(bind=meta.engine, checkfirst=False) - - ### Load some basic data + # Initialisation here ... this sort of stuff: # Users identity_url = IdentityURL(url=u'http://eevee.livejournal.com/') user = User(name=u'Eevee') user.identity_urls.append(identity_url) - elixir.session.commit() + + # some_entity = model.Session.query(model..).get(1) + # e.g. foo = model.Session.query(model.identity.User).get(1) + # from datetime import datetime + # some_entity.poked_on = datetime.now() + # model.Session.add(some_entity) + model.Session.commit()