[Grok-dev] schema.Time() ComponentLookupError wierdness...

Sebastian Ware sebastian at urbantalk.se
Fri Sep 14 12:04:12 EDT 2007


I get the wonderful...

   ComponentLookupError: ((<zope.schema._field.Time object at  
0x3480190>, <zope.publisher.browser.BrowserRequest instance  
URL=http://localhost:8081/dynasales/default/project_1/sales_desks/ 
sales_rep_1/dashboard>), <InterfaceClass  
zope.app.form.interfaces.IInputWidget>, u'')

...when I am trying to render a widget based on the following schema:

   class ISalesAction(Interface):
     """
     This is actual text in a section.
     """
     due_date = schema.Date(title=u"Due date", required=False)
     due_time = schema.Time(title=u"Due time", required=False)
     type = schema.Choice(title=u"Type", values=('ToDo', 'ToCall'))

The actual object being passed has been instantiated like this:

   class SalesAction(grok.Model):
     interface.implements(interfaces.ISalesAction)
       def __init__(self):
         self.type = None
         self.due_date = None
         self.due_time = None

There is no problem with the due_date widget. As usual with comonent  
lookup errors I am at a loss... :) Full trace bellow. When I omit the  
"due_time" field, it all renders fine. Any ideas?

Note, the pagetemplate is called by another pagetemplate which in  
turn is called by another pagetemplate. But I don't think this should  
make any difference.

Mvh Sebastian

------
2007-09-14T17:57:27 INFO root -- HTTP:localhost:8081 Server started.
	Hostname: localhost
	Port: 8081
------
2007-09-14T17:57:27 INFO root Startup time: 3.077 sec real, 2.550 sec  
CPU
------
2007-09-14T17:57:33 ERROR SiteError http://localhost:8081/dynasales/ 
default/project_1/sales_desks/sales_rep_1/dashboard
Traceback (most recent call last):
   File "/Users/jhsware/buildout-eggs/tmpJv6Esb/ 
zope.publisher-3.5.0a1.dev_r78838-py2.4.egg/zope/publisher/ 
publish.py", line 133, in publish
   File "/Users/jhsware/buildout-eggs/grok-0.10-py2.4.egg/grok/ 
publication.py", line 41, in callObject
     return super(ZopePublicationSansProxy, self).callObject(request,  
ob)
   File "/Users/jhsware/buildout-eggs/tmpC0QULo/ 
zope.app.publication-3.4.0a1_2-py2.4.egg/zope/app/publication/ 
zopepublication.py", line 167, in callObject
   File "/Users/jhsware/buildout-eggs/tmpJv6Esb/ 
zope.publisher-3.5.0a1.dev_r78838-py2.4.egg/zope/publisher/ 
publish.py", line 108, in mapply
    - __traceback_info__: <dynasales.salesdesk.Dashboard object at  
0x17c2650>
   File "/Users/jhsware/buildout-eggs/tmpJv6Esb/ 
zope.publisher-3.5.0a1.dev_r78838-py2.4.egg/zope/publisher/ 
publish.py", line 114, in debug_call
   File "/Users/jhsware/buildout-eggs/grok-0.10-py2.4.egg/grok/ 
components.py", line 124, in __call__
     return self._render_template()
   File "/Users/jhsware/buildout-eggs/grok-0.10-py2.4.egg/grok/ 
components.py", line 134, in _render_template
     return self.template.pt_render(namespace)
   File "/Users/jhsware/buildout-eggs/tmpgrbq9U/ 
zope.pagetemplate-3.4.0a1-py2.4.egg/zope/pagetemplate/ 
pagetemplate.py", line 115, in pt_render
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 271, in __call__
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 891, in do_useMacro
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 536, in do_optTag_tal
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 521, in do_optTag
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 516, in no_tag
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 949, in do_defineSlot
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 536, in do_optTag_tal
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 521, in do_optTag
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 516, in no_tag
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 855, in do_condition
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 534, in do_optTag_tal
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 516, in no_tag
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 745, in  
do_insertStructure_tal
   File "/Users/jhsware/buildout-eggs/tmpHF3RLb/zope.tales-3.4.0a1- 
py2.4.egg/zope/tales/tales.py", line 696, in evaluate
    - /Users/jhsware/GrokProjects/Dynasales/src/dynasales/ 
salesdesk_templates/dashboard.pt
    - Line 17, Column 20
    - Expression: <PathExpr standard:u'view/edit_object/ 
@@historywidget'>
    - Names:
       {'args': (),
        'context': <dynasales.salesdesk.SalesDesk object at 0x346beb0>,
        'default': <object object at 0x38d558>,
        'loop': {},
        'nothing': None,
        'options': {},
        'repeat': {},
        'request': <zope.publisher.browser.BrowserRequest instance  
URL=http://localhost:8081/dynasales/default/project_1/sales_desks/ 
sales_rep_1/dashboard>,
        'static': <grok.components.DirectoryResource object at  
0x17ecff0>,
        'template': <dashboard template in /Users/jhsware/ 
GrokProjects/Dynasales/src/dynasales/salesdesk_templates/dashboard.pt>,
        'view': <dynasales.salesdesk.Dashboard object at 0x17c2650>}
   File "/Users/jhsware/buildout-eggs/tmpHF3RLb/zope.tales-3.4.0a1- 
py2.4.egg/zope/tales/expressions.py", line 217, in __call__
   File "/Users/jhsware/buildout-eggs/tmpHF3RLb/zope.tales-3.4.0a1- 
py2.4.egg/zope/tales/expressions.py", line 211, in _eval
   File "/Users/jhsware/buildout-eggs/grok-0.10-py2.4.egg/grok/ 
components.py", line 387, in __call__
     return self.render()
   File "/Users/jhsware/buildout-eggs/grok-0.10-py2.4.egg/grok/ 
components.py", line 370, in render
     self.form_result = self._render_template()
   File "/Users/jhsware/buildout-eggs/grok-0.10-py2.4.egg/grok/ 
components.py", line 134, in _render_template
     return self.template.pt_render(namespace)
   File "/Users/jhsware/buildout-eggs/tmpgrbq9U/ 
zope.pagetemplate-3.4.0a1-py2.4.egg/zope/pagetemplate/ 
pagetemplate.py", line 115, in pt_render
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 271, in __call__
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 855, in do_condition
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 534, in do_optTag_tal
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 516, in no_tag
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 346, in interpret
   File "/Users/jhsware/buildout-eggs/tmp5Oq2KR/zope.tal-3.4.0b1- 
py2.4.egg/zope/tal/talinterpreter.py", line 745, in  
do_insertStructure_tal
   File "/Users/jhsware/buildout-eggs/tmpHF3RLb/zope.tales-3.4.0a1- 
py2.4.egg/zope/tales/tales.py", line 696, in evaluate
    - /Users/jhsware/GrokProjects/Dynasales/src/dynasales/ 
saleslead_templates/historywidget.pt
    - Line 1, Column 0
    - Expression: <PathExpr standard:u'view/edit_object/@@editwidget'>
    - Names:
       {'args': (),
        'context': <dynasales.saleslead.SalesLead object at 0x346bcb0>,
        'default': <object object at 0x38d558>,
        'loop': {},
        'nothing': None,
        'options': {},
        'repeat': {},
        'request': <zope.publisher.browser.BrowserRequest instance  
URL=http://localhost:8081/dynasales/default/project_1/sales_desks/ 
sales_rep_1/dashboard>,
        'static': <grok.components.DirectoryResource object at  
0x34728f0>,
        'template': <historywidget template in /Users/jhsware/ 
GrokProjects/Dynasales/src/dynasales/saleslead_templates/ 
historywidget.pt>,
        'view': <dynasales.saleslead.HistoryWidget object at 0x3472850>}
   File "/Users/jhsware/buildout-eggs/tmpHF3RLb/zope.tales-3.4.0a1- 
py2.4.egg/zope/tales/expressions.py", line 217, in __call__
   File "/Users/jhsware/buildout-eggs/tmpHF3RLb/zope.tales-3.4.0a1- 
py2.4.egg/zope/tales/expressions.py", line 211, in _eval
   File "/Users/jhsware/buildout-eggs/grok-0.10-py2.4.egg/grok/ 
components.py", line 386, in __call__
     self.update_form()
   File "/Users/jhsware/buildout-eggs/grok-0.10-py2.4.egg/grok/ 
components.py", line 358, in update_form
     super(GrokForm, self).update()
   File "/Users/jhsware/buildout-eggs/tmpuWvQE0/zope.formlib-3.4.0a1- 
py2.4.egg/zope/formlib/form.py", line 736, in update
   File "/Users/jhsware/buildout-eggs/tmpuWvQE0/zope.formlib-3.4.0a1- 
py2.4.egg/zope/formlib/form.py", line 806, in setUpWidgets
   File "/Users/jhsware/buildout-eggs/tmpuWvQE0/zope.formlib-3.4.0a1- 
py2.4.egg/zope/formlib/form.py", line 397, in setUpEditWidgets
   File "/Users/jhsware/buildout-eggs/tmpuWvQE0/zope.formlib-3.4.0a1- 
py2.4.egg/zope/formlib/form.py", line 327, in _createWidget
   File "/Users/jhsware/buildout-eggs/tmphadT-V/ 
zope.component-3.4.0a1-py2.4.egg/zope/component/_api.py", line 103,  
in getMultiAdapter
ComponentLookupError: ((<zope.schema._field.Time object at  
0x3480190>, <zope.publisher.browser.BrowserRequest instance  
URL=http://localhost:8081/dynasales/default/project_1/sales_desks/ 
sales_rep_1/dashboard>), <InterfaceClass  
zope.app.form.interfaces.IInputWidget>, u'')



More information about the Grok-dev mailing list