fixed empty tag form submission
[zzz-floof.git] / floof / websetup.py
index a812633..b1611c9 100644 (file)
@@ -1,14 +1,32 @@
+# -*- coding: utf-8 -*-
 """Setup the floof application"""
 import logging
 
 from floof.config.environment import load_environment
 """Setup the floof application"""
 import logging
 
 from floof.config.environment import load_environment
-from floof.model import meta
 
 log = logging.getLogger(__name__)
 
 
 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)
 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()
+
+    # Initialisation here ... this sort of stuff:
+
+    # Users
+    from floof.model.users import IdentityURL, User
+    identity_url = IdentityURL(url=u'http://eevee.livejournal.com/')
+    user = User(name=u'Eevee')
+    user.identity_urls.append(identity_url)
+
 
 
-    # Create the tables if they don't already exist
-    meta.metadata.create_all(bind=meta.engine)
+    # some_entity = model.Session.query(model.<modelfile>.<Some_Entity>).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()