Hi,

I saw that SqlAlchemy is supposedly compatible with DBMechanic which
is some kind of replacement for Catwalk. However, when following the
DBMechanic website's instructions, I end up with an error. I do the
following in my controller.py file:

from model import metadata
from dbsprockets.dbmechanic.frameworks.tg import DBMechanic
from dbsprockets.saprovider import SAProvider

class Root(controllers.RootController):
    dbmechanic = DBMechanic(SAProvider(metadata), '/dbmechanic')

   <rest of code cut for brevity ... >


This gives me a huge traceback:


Page handler: <bound method DBMechanic.index of
<dbsprockets.dbmechanic.frameworks.tg.dbmechanic.DBMechanic object at
0x0178E410>>
Traceback (most recent call last):
  File "c:\python24\lib\site-packages\cherrypy-2.3.0-py2.4.egg\cherrypy
\_cphttptools.py", line 121, in _run
    self.main()
  File "c:\python24\lib\site-packages\cherrypy-2.3.0-py2.4.egg\cherrypy
\_cphttptools.py", line 264, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in index
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\controllers.py", line 361, in expose
    output = database.run_with_transaction(
  File "<string>", line 5, in run_with_transaction
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\database.py", line 406, in sa_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\controllers.py", line 378, in <lambda>
    mapping, fragment, args, kw)))
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\controllers.py", line 418, in _execute_func
    return _process_output(output, template, format, content_type,
mapping, fragment)
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\controllers.py", line 86, in _process_output
    fragment=fragment)
  File "c:\python24\lib\site-packages\TurboGears-1.0.4.3-py2.4.egg
\turbogears\view\base.py", line 129, in render
    return engine.render(**kw)
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\template\plugin.py", line 104, in render
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\core.py", line 154, in render
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\output.py", line 45, in encode
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\output.py", line 369, in __call__
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\output.py", line 618, in __call__
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\output.py", line 679, in __call__
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\output.py", line 459, in __call__
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\core.py", line 212, in _ensure
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\template\markup.py", line 252, in _include
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\template\markup.py", line 322, in _match
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\template\markup.py", line 252, in _include
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\template\markup.py", line 297, in _match
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\template\markup.py", line 286, in _strip
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\template\markup.py", line 242, in _exec
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\template\base.py", line 421, in _eval
  File "c:\python24\lib\site-packages\genshi-0.4.4-py2.4.egg\genshi
\template\eval.py", line 136, in evaluate
  File "c:\python24\lib\site-packages\dbsprockets-0.2b1dev_r225-
py2.4.egg\dbsprockets\dbmechanic\frameworks\tg\templates\index.html",
line 11, in <Expression u'databaseView(value=databaseValue,
controller=controller)'>
    ${databaseView(value=databaseValue, controller=controller)}
  File "c:\python24\lib\site-packages\ToscaWidgets-0.2rc3dev_r3795-
py2.4.egg\toscawidgets\core.py", line 467, in __call__
    return self.display(value, **kw)
  File "c:\python24\lib\site-packages\ToscaWidgets-0.2rc3dev_r3795-
py2.4.egg\toscawidgets\core.py", line 463, in display
    kw = self.prepare_dict(value, kw)
  File "c:\python24\lib\site-packages\ToscaWidgets-0.2rc3dev_r3795-
py2.4.egg\toscawidgets\core.py", line 507, in prepare_dict
    self.update_params(d)
  File "c:\python24\lib\site-packages\ToscaWidgets-0.2rc3dev_r3795-
py2.4.egg\toscawidgets\core.py", line 563, in update_params
    self._calls_for_request
  File "c:\python24\lib\site-packages\ToscaWidgets-0.2rc3dev_r3795-
py2.4.egg\toscawidgets\util.py", line 235, in __get__
    return getattr(request_local, self.name)
  File "c:\python24\lib\site-packages\Paste-1.5.1-py2.4.egg\paste
\registry.py", line 125, in __getattr__
    return getattr(self._current_obj(), attr)
  File "c:\python24\lib\site-packages\Paste-1.5.1-py2.4.egg\paste
\registry.py", line 180, in _current_obj
    raise TypeError(
TypeError: No object (name: ToscaWidgets per-request storage) has been
registered for this thread


I am following the instructions found here: 
http://code.google.com/p/dbsprockets/
Also, I am currently trying to work my way through the Spree tutorial
found here: http://www.splee.co.uk/2006/10/14/simpleblog-part-1/

Unfortunately, its code for creating a blog post via the tg-admin
shell does not work which is why I was trying the dbMechanic. Any
advice is welcome.

Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to