[Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers
Jim Fulton wrote: snip __call__ stuff Okay, this is almost the same, but apparently not the same. I have a Python Product Class, with a method, a_method, that gets called from some of the Python Product's management screens (encapsulation is good ;-) This method needs several parameters from

Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Toby Dickenson
On Fri, 13 Oct 2000 11:48:39 +0100, Chris Withers [EMAIL PROTECTED] wrote: I have a Python Product Class, with a method, a_method, that gets called from some of the Python Product's management screens (encapsulation is good ;-) This method needs several parameters from the namespace, so when

Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers
Toby Dickenson wrote: http://www.zope.org/Members/htrd/howto/FunctionTemplate you would use def a_method(self,md): do_stuff_with(md['param1'],md['param2']) a_method = FunctionTemplate(a_method) That looks like it'll do the trick... I wonder if there's any way you can

RE: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Toby Dickenson
That looks like it'll do the trick... I wonder if there's any way you can role it up into a Product so that I don't need to have FunctionTemplate.py in each folder of a product that needs to use it? Im working on a set of tools to aid my transition to a dtml-free Zope. Eventually I will

Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers
Toby Dickenson wrote: That looks like it'll do the trick... I wonder if there's any way you can role it up into a Product so that I don't need to have FunctionTemplate.py in each folder of a product that needs to use it? Im working on a set of tools to aid my transition to a dtml-free

Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers
Toby Dickenson wrote: http://www.zope.org/Members/htrd/howto/FunctionTemplate you would use def a_method(self,md): do_stuff_with(md['param1'],md['param2']) a_method = FunctionTemplate(a_method) Okay, spoke too soon... when I do the above and then call the method

Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers
Jim Fulton wrote: In any case, if you *just* want to get your function to be called from DTML (and your class is an extension class), you can give it the isDocTemp attribute like so: class MyClass( include some extension class ...): some_methodisDocTemp=1 def

Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Shane Hathaway
Jim Fulton wrote: Chris Withers wrote: Toby Dickenson wrote: http://www.zope.org/Members/htrd/howto/FunctionTemplate you would use def a_method(self,md): do_stuff_with(md['param1'],md['param2']) a_method = FunctionTemplate(a_method) That looks

Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Jim Fulton
Shane Hathaway wrote: Jim Fulton wrote: Chris Withers wrote: Toby Dickenson wrote: http://www.zope.org/Members/htrd/howto/FunctionTemplate you would use def a_method(self,md): do_stuff_with(md['param1'],md['param2']) a_method =

Re: [Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Shane Hathaway
Jim Fulton wrote: The fact that ZPublisher will pass it is documented. Whether or not something else calls it is up to the something else. The method designer specified an interface that includes RESPONSE. If it requires RESPONSE, by not specifying a default, then it requires the clients to