# Try to pull a name out of the SReg response
sreg_res = SRegResponse.fromSuccessResponse(res)
try:
- username = sreg_res['nickname']
+ username = unicode(sreg_res['nickname'])
except:
- username = 'Anonymous'
+ username = u'Anonymous'
# Create db records
user = User(name=username)
"""Setup the floof application"""
+import elixir
import logging
from floof.config.environment import load_environment
from floof.model import meta
-import elixir
+from floof.model.users import IdentityURL, User
log = logging.getLogger(__name__)
# Create the tables if they don't already exist
elixir.create_all(bind=meta.engine, checkfirst=False)
+
+ ### Load some basic data
+
+ # Users
+ identity_url = IdentityURL(url=u'http://eevee.livejournal.com/')
+ user = User(name=u'Eevee')
+ user.identity_urls.append(identity_url)
+
+ elixir.session.commit()