ptahproject/ptah — Issue #119: remove ptah settings on startup
Author: runyaga
Created: 2012-01-04 17:14:30+00:00
State: open

init_sql for ptah should be optional. you should not have to init it for ptah to work.
currently if you comment it out in examples/simple it fails with

c:\ptah\birthday\src\examples\simple>c:\ptah\birthday\Scripts\python.exe layout.
py
Traceback (most recent call last):
File "layout.py", line 151, in
app = config.make_wsgi_app()
File "c:\ptah\birthday\lib\site-packages\pyramid-1.3a3-py2.7.egg\pyramid\confi
g\__init__.py", line 914, in make_wsgi_app
self.registry.notify(ApplicationCreated(app))
File "c:\ptah\birthday\lib\site-packages\pyramid-1.3a3-py2.7.egg\pyramid\regis
try.py", line 74, in notify
[ _ for _ in self.subscribers(events, None) ]
File "c:\ptah\birthday\lib\site-packages\zope\interface\registry.py", line 336
, in subscribers
return self.adapters.subscribers(objects, provided)
File "c:\ptah\birthday\lib\site-packages\zope\interface\adapter.py", line 583,
in subscribers
subscription(*objects)
File "c:\ptah\birthday\src\ptah\ptah\ptahsettings.py", line 240, in starting
s_ob.load_fromdb()
File "c:\ptah\birthday\src\ptah\ptah\settings.py", line 198, in load_fromdb
self.load(dict(ptah.get_session().query(SettingRecord.name,SettingRecord.val
ue)))
File "build\bdist.win32\egg\sqlalchemy\orm\query.py", line 2057, in __iter__
File "build\bdist.win32\egg\sqlalchemy\orm\query.py", line 2070, in _execute_a
nd_instances
File "build\bdist.win32\egg\sqlalchemy\orm\query.py", line 2061, in _connectio
n_from_session
File "build\bdist.win32\egg\sqlalchemy\orm\session.py", line 716, in connectio
n
File "build\bdist.win32\egg\sqlalchemy\orm\session.py", line 964, in get_bind
sqlalchemy.exc.UnboundExecutionError: Could not locate a bind configured on SQL
expression or this Session