Let us have an RestController-derived class with the following method:

    # Handles the 'PUT' operation from an 'Edit' form
    @expose()
    @registered_validate(error_handler=edit)
    @catch_errors(SQLAlchemyError, error_handler=new)
    def put(self, *args, **kw):
        pks = self.provider.get_primary_fields(self.model)
        params = kw
        for i, pk in enumerate(pks):
            if pk not in kw and i < len(args):
                params[pk] = args[i]

        self.provider.update(self.model, params=params)
        raise redirect('./')

In case of an SQLAlchemyError, the error handler fails, giving
following:

URL: http://localhost:8080/customers/1/contracts/
File '/usr/lib/python2.5/site-packages/WebError-0.9.1-py2.5.egg/
weberror/evalexception.py', line 428 in respond
  app_iter = self.application(environ, detect_start_response)
File '/home/[...]/tg2/tg/configuration.py', line 649 in wrapper
  return app(environ, start_response)
File '/home/[...]/tg2/tg/configuration.py', line 552 in remover
  return app(environ, start_response)
File '/usr/lib/python2.5/site-packages/repoze.tm2-1.0a3-py2.5.egg/
repoze/tm/__init__.py', line 19 in __call__
  result = self.application(environ, save_status_and_headers)
File '/usr/lib/python2.5/site-packages/ToscaWidgets-0.9.5dev_20081026-
py2.5.egg/tw/core/middleware.py', line 36 in __call__
  return self.wsgi_app(environ, start_response)
File '/usr/lib/python2.5/site-packages/ToscaWidgets-0.9.5dev_20081026-
py2.5.egg/tw/core/middleware.py', line 59 in wsgi_app
  resp = req.get_response(self.application)
File 'build/bdist.linux-x86_64/egg/webob/__init__.py', line 1337 in
get_response
File 'build/bdist.linux-x86_64/egg/webob/__init__.py', line 1305 in
call_application
File '/usr/lib/python2.5/site-packages/ToscaWidgets-0.9.5dev_20081026-
py2.5.egg/tw/core/resource_injector.py', line 67 in _injector
  resp = req.get_response(app)
File 'build/bdist.linux-x86_64/egg/webob/__init__.py', line 1337 in
get_response
File 'build/bdist.linux-x86_64/egg/webob/__init__.py', line 1305 in
call_application
File '/usr/lib/python2.5/site-packages/Beaker-1.1.3-py2.5.egg/beaker/
middleware.py', line 81 in __call__
  return self.app(environ, start_response)
File '/usr/lib/python2.5/site-packages/Beaker-1.1.3-py2.5.egg/beaker/
middleware.py', line 159 in __call__
  return self.wrap_app(environ, session_start_response)
File '/usr/lib/python2.5/site-packages/Routes-1.10.2-py2.5.egg/routes/
middleware.py', line 118 in __call__
  response = self.app(environ, start_response)
File '/usr/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/
pylons/wsgiapp.py', line 117 in __call__
  response = self.dispatch(controller, environ, start_response)
File '/usr/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/
pylons/wsgiapp.py', line 316 in dispatch
  return controller(environ, start_response)
File '/usr/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/
pylons/controllers/core.py', line 204 in __call__
  response = self._dispatch_call()
File '/usr/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/
pylons/controllers/core.py', line 159 in _dispatch_call
  response = self._inspect_call(func)
File '/usr/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/
pylons/controllers/core.py', line 95 in _inspect_call
  result = self._perform_call(func, args)
File '/home/[...]/tg2/tg/controllers.py', line 658 in _perform_call
  self, controller, params, remainder=remainder)
File '/home/[...]/tg2/tg/controllers.py', line 119 in _perform_call
  output = controller(*remainder, **dict(params))
File '<string>', line 1 in <lambda>
File 'build/bdist.linux-x86_64/egg/tgext/crud/decorators.py', line 89
in wrapper
File '/home/[...]/tg2/tg/controllers.py', line 102 in _perform_call
  pylons.request.start_response = self.start_response
AttributeError: 'ContractsController' object has no attribute
'start_response'

Indeed, looking into tg2/tg/controllers.py, line 102 is the only one
to have self.start_response mentioned.

I'm using TG2 from trunk now.
Everything else seems to work just fine and the gears really do
rock&roll ;)
--~--~---------~--~----~------------~-------~--~----~
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