> When I call turbogears.url() I get this error, basically cherrypy has
> not yet placed the app_path in the request object. I put a trace in the
> function that sets the app_path and it does seem to call successfully
> on its own. I'm not sure if it's a different request object that it is
> trying to reference or what.
>
>
> Page handler: <bound method Reseller.Configuration of
> <eltopiacomm.reseller.Reseller instance at 0x01253E18>>
> Traceback (most recent call last):
> File
> "d:\python24\lib\site-packages\CherryPy-2.2.0beta-py2.4.egg\cherrypy\_cphttptools.py",
> line 98, in _run
> self.main()
> File
> "d:\python24\lib\site-packages\CherryPy-2.2.0beta-py2.4.egg\cherrypy\_cphttptools.py",
> line 246, in main
> body = page_handler(*virtual_path, **self.params)
> File
> "d:\python24\lib\site-packages\turbogears-0.9a0dev_r519-py2.4.egg\turbogears\controllers.py",
> line 240, in newfunc
> html, fragment, *args, **kw)
> File
> "d:\python24\lib\site-packages\turbogears-0.9a0dev_r519-py2.4.egg\turbogears\database.py",
> line 189, in run_with_transaction
> retval = func(*args, **kw)
> File
> "d:\python24\lib\site-packages\turbogears-0.9a0dev_r519-py2.4.egg\turbogears\controllers.py",
> line 257, in _execute_func
> output = func(self, *args, **kw)
> File
> "d:\python24\lib\site-packages\turbogears-0.9a0dev_r519-py2.4.egg\turbogears\identity\conditions.py",
> line 230, in _wrapper
> return fn( self, *args, **kwargs )
> File "D:\devstuff\EltopiaComm\eltopiacomm\reseller.py", line 48, in
> Configuration
> self.cpnydict, self.condict, self.voipdict =
> createConfigDicts(oper)
> File "D:\devstuff\EltopiaComm\eltopiacomm\reseller_content.py", line
> 41, in createConfigDicts
>
> constraintUrl=turbogears.url('/modCountry?countryID=##+tg_format=json')),
> File
> "d:\python24\lib\site-packages\turbogears-0.9a0dev_r519-py2.4.egg\turbogears\util.py",
> line 87, in url
> if cherrypy.request.app_path != "/":
> File
> "d:\python24\lib\site-packages\CherryPy-2.2.0beta-py2.4.egg\cherrypy\__init__.py",
> line 42, in __getattr__
> return getattr(childobject, name)
> AttributeError: 'Request' object has no attribute 'app_path'
FYI, this checkin in CP was just a proof of concept and it might very
well be removed from the trunk soon ...
So you shouldn't rely on this API.
Remi.