I tried using DBMechanic in a newly quickstarted project. I used the
following controller code:

from turbogears.database import metadata
from dbsprockets.dbmechanic.frameworks.tg import DBMechanic
from dbsprockets.saprovider import SAProvider

class Root(controllers.RootController):

    dbmechanic = DBMechanic(SAProvider(metadata), '/dbmechanic')

On pointing my browser to http://localhost:8080/dbmechanic I get the
following error:-

Page handler: <bound method DBMechanic.index of
<dbsprockets.dbmechanic.frameworks.tg.dbmechanic.DBMechanic object at
0xaa264cc>>
Traceback (most recent call last):
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/CherryPy-2.3.0-
py2.5.egg/cherrypy/_cphttptools.py", line 121, in _run
    self.main()
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/CherryPy-2.3.0-
py2.5.egg/cherrypy/_cphttptools.py", line 264, in main
    body = page_handler(*virtual_path, **self.params)
  File "<string>", line 3, in index
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/
TurboGears-1.0.4.3-py2.5.egg/turbogears/controllers.py", line 363, in
expose
    *args, **kw)
  File "<string>", line 5, in run_with_transaction
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/
TurboGears-1.0.4.3-py2.5.egg/turbogears/database.py", line 406, in
sa_rwt
    retval = func(*args, **kw)
  File "<string>", line 5, in _expose
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/
TurboGears-1.0.4.3-py2.5.egg/turbogears/controllers.py", line 378, in
<lambda>
    mapping, fragment, args, kw)))
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/
TurboGears-1.0.4.3-py2.5.egg/turbogears/controllers.py", line 418, in
_execute_func
    return _process_output(output, template, format, content_type,
mapping, fragment)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/
TurboGears-1.0.4.3-py2.5.egg/turbogears/controllers.py", line 86, in
_process_output
    fragment=fragment)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/
TurboGears-1.0.4.3-py2.5.egg/turbogears/view/base.py", line 129, in
render
    return engine.render(**kw)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/template/plugin.py", line 104, in render
    return self.transform(info, template).render(**kwargs)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/core.py", line 154, in render
    return encode(generator, method=method, encoding=encoding)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/output.py", line 45, in encode
    output = u''.join(list(iterator))
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/output.py", line 369, in __call__
    for kind, data, pos in stream:
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/output.py", line 618, in __call__
    for kind, data, pos in stream:
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/output.py", line 679, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/output.py", line 459, in __call__
    for ev in stream:
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/core.py", line 212, in _ensure
    for event in stream:
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/template/markup.py", line 252, in _include
    for event in stream:
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/template/markup.py", line 322, in _match
    content = list(self._include(content, ctxt))
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/template/markup.py", line 252, in _include
    for event in stream:
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/template/markup.py", line 297, in _match
    for event in stream:
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/template/markup.py", line 286, in _strip
    event = stream.next()
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/template/markup.py", line 242, in _exec
    for event in stream:
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/template/base.py", line 421, in _eval
    result = data.evaluate(ctxt)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Genshi-0.4.4-
py2.5.egg/genshi/template/eval.py", line 136, in evaluate
    return eval(self.code, _globals, {'data': data})
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/
DBSprockets-0.2rc2_r316-py2.5.egg/dbsprockets/dbmechanic/frameworks/tg/
templates/index.html", line 11, in <Expression
u'databaseView(value=databaseValue, controller=controller)'>
    ${databaseView(value=databaseValue, controller=controller)}
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/ToscaWidgets-0.2-
py2.5.egg/toscawidgets/core.py", line 472, in __call__
    return self.display(value, **kw)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/ToscaWidgets-0.2-
py2.5.egg/toscawidgets/core.py", line 468, in display
    kw = self.prepare_dict(value, kw)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/ToscaWidgets-0.2-
py2.5.egg/toscawidgets/core.py", line 512, in prepare_dict
    self.update_params(d)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/ToscaWidgets-0.2-
py2.5.egg/toscawidgets/core.py", line 568, in update_params
    self._calls_for_request
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/ToscaWidgets-0.2-
py2.5.egg/toscawidgets/util.py", line 235, in __get__
    return getattr(request_local, self.name)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Paste-1.6-
py2.5.egg/paste/registry.py", line 125, in __getattr__
    return getattr(self._current_obj(), attr)
  File "/home/sanjiv/pytg/lib/python2.5/site-packages/Paste-1.6-
py2.5.egg/paste/registry.py", line 182, in _current_obj
    'thread' % self.____name__)
TypeError: No object (name: ToscaWidgets per-request storage) has been
registered for this thread

What am I doing wrong?

Thanks

--~--~---------~--~----~------------~-------~--~----~
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