On Friday 10 August 2007 06:54:46 Kevin Horn wrote:
> hmmm, this doesn't work for me, I get the following traceback on starting
> the app (start-xxx.py):
>
> Traceback (most recent call last):
> File "E:\data\code\TurboGears\webtoolspy\start-webtools.py", line 33, in
> ? from webtools.controllers import Root
> File "E:\data\code\TurboGears\webtoolspy\webtools\controllers.py", line
> 28, in
> ?
> from subcontrollers.projectcontroller import Projects
> File
> "E:\data\code\TurboGears\webtoolspy\webtools\subcontrollers\projectcontro
> ller.py", line 18, in ?
> import webtools.appwidgets.invoicewidgets as iw
> File
> "E:\data\code\TurboGears\webtoolspy\webtools\appwidgets\invoicewidgets.py
> ", line 19, in ?
> class InvoiceFormFields(widgets.WidgetsList):
> File
> "E:\data\code\TurboGears\webtoolspy\webtools\appwidgets\invoicewidgets.py
> ", line 22, in InvoiceFormFields
> options=get_billable_items_options,
> File "d:\python24\lib\site-packages\TurboGears-
> 1.0.1-py2.4.egg\turbogears\widg
> ets\meta.py", line 142, in widget_init
> func(self, *args, **kw)
> File "d:\python24\lib\site-packages\TurboGears-
> 1.0.1-py2.4.egg\turbogears\widg
> ets\forms.py", line 837, in __init__
> validator = self._guess_validator()
> File "d:\python24\lib\site-packages\TurboGears-
> 1.0.1-py2.4.egg\turbogears\widg
> ets\forms.py", line 857, in _guess_validator
> sample_option = self._get_sample_option()
> File "d:\python24\lib\site-packages\TurboGears-
> 1.0.1-py2.4.egg\turbogears\widg
> ets\forms.py", line 870, in _get_sample_option
> options = self._extend_options(self.options)
> File "d:\python24\lib\site-packages\TurboGears-
> 1.0.1-py2.4.egg\turbogears\widg
> ets\meta.py", line 95, in __get__
> return param()
> File
> "E:\data\code\TurboGears\webtoolspy\webtools\appwidgets\invoicewidgets.py
> ", line 13, in get_billable_items_options
> bis = BillableItem.select(BillableItem.q.projectID ==
> cherrypy.request.param
> s['project_id'])
> File "D:\Python24\lib\site-packages\cherrypy-
> 2.2.1-py2.4.egg\cherrypy\__init__
> .py", line 42, in __getattr__
> childobject = getattr(serving, self.__attrname__)
> AttributeError: 'thread._local' object has no attribute 'request'
You need to guard that with a if:
import turbogears.util
def foo():
if turgogears.util.request_available():
...
return ('dummy',)
Something like that.
Sorry for the confusion,
Diez
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---