[Zope3-Users] Widget Error on direct __call__ with pt

2006-12-07 Thread Dennis Schulz
The error occurs when try to get the widget structure of the 
objectwidget in my page tamplate:

   
tal:content="structure widget">

   
In the earlier version (with the html dirctly in the call method) this 
was necessary.

Is there a problem with ZopeTwoPageTemplateFile?

Dennis

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Widget Error on direct __call__ with pt

2006-12-07 Thread Dennis Schulz

Hello,


I am using the following code for a sequence widget.


class TableRecordSequenceWidget(ListSequenceWidget):
   def __init__(self, context, field, request, template_='', 
subwidget=None):

   super(TableRecordSequenceWidget, self).__init__(
   context, field, request, subwidget)
   def __call__(self):
   render sth


It works good as long as I write the rendered html directly in the 
__call__ method.
But after a while it gets dirty, I would like to have it in a page 
template..


However when I try to change it to return a page template in the call 
method,


(like I found it in many examples)

   def __call__(self):
   class TemplateObjectWidgetView(ObjectWidgetView):
   template = ZopeTwoPageTemplateFile("itemwidget.pt")
   template = TemplateObjectWidgetView(self, self.request)
   return template()

I have the following error:

Any help? Again, the version without the page template works perfectly

   
tal:content="structure widget">

   


 Module ZPublisher.Publish, line 115, in publish
 Module ZPublisher.mapply, line 88, in mapply
 Module ZPublisher.Publish, line 41, in call_object
 Module zope.formlib.form, line 898, in __call__
 Module zope.formlib.form, line 892, in render
 Module Shared.DC.Scripts.Bindings, line 311, in __call__
 Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
 Module Products.PageTemplates.PageTemplateFile, line 113, in _exec
 Module Products.PageTemplates.PageTemplate, line 104, in pt_render
  - 
 Module TAL.TALInterpreter, line 238, in __call__
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 749, in do_useMacro
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 457, in do_optTag_tal
 Module TAL.TALInterpreter, line 442, in do_optTag
 Module TAL.TALInterpreter, line 437, in no_tag
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 749, in do_useMacro
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 457, in do_optTag_tal
 Module TAL.TALInterpreter, line 442, in do_optTag
 Module TAL.TALInterpreter, line 437, in no_tag
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 780, in do_defineSlot
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 457, in do_optTag_tal
 Module TAL.TALInterpreter, line 442, in do_optTag
 Module TAL.TALInterpreter, line 437, in no_tag
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 728, in do_defineMacro
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 772, in do_defineSlot
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 728, in do_defineMacro
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 780, in do_defineSlot
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 772, in do_defineSlot
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 749, in do_useMacro
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 457, in do_optTag_tal
 Module TAL.TALInterpreter, line 442, in do_optTag
 Module TAL.TALInterpreter, line 437, in no_tag
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 780, in do_defineSlot
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 457, in do_optTag_tal
 Module TAL.TALInterpreter, line 442, in do_optTag
 Module TAL.TALInterpreter, line 437, in no_tag
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 749, in do_useMacro
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 457, in do_optTag_tal
 Module TAL.TALInterpreter, line 442, in do_optTag
 Module TAL.TALInterpreter, line 437, in no_tag
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 749, in do_useMacro
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 457, in do_optTag_tal
 Module TAL.TALInterpreter, line 442, in do_optTag
 Module TAL.TALInterpreter, line 437, in no_tag
 Module TAL.TALInterpreter, line 281, in interpret
 Module TAL.TALInterpreter, line 647, in do_insertStructure_tal
 Module Products.PageTemplates.TALES, line 221, in evaluate
  - URL: index
  - Line 286, Column 4
  - Expression: standard:'widget'
  - Names:
 {'container': /Plone/purchaserequisition.2006-11-29.5884219316/pr/196>,
  'context': /Plone/purchaserequisition.2006-11-29.5884219316/pr/196>,
  'default': 0x017EB5F8>,
  'here': /Plone/purchaserequisition.2006-11-29.5884219316/pr/196>,
  'loop': 0x05BAB440>,
  'modules': 
0x017D8B48>,

  'nothing': None,
  'options': {'args': ()},
  'repeat': 0x05BAB440>,
  'request': URL=http://localhost:808