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 client

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

2000-10-13 Thread Jim Fulton
Shane Hathaway wrote: > > Jim Fulton wrote: > > > > Shane Hathaway wrote: > > > > > > Jim Fulton wrote: > > > > Note that if you get called from the web, RESPONSE will > > > > not be none. This is a handy way to decide if you > > > > are called from the web or as a sub-template. Of course, > > >

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

2000-10-13 Thread Shane Hathaway
Jim Fulton wrote: > > Shane Hathaway wrote: > > > > Jim Fulton wrote: > > > Note that if you get called from the web, RESPONSE will > > > not be none. This is a handy way to decide if you > > > are called from the web or as a sub-template. Of course, > > > someone could pass a non-None RESPONSE a

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

2000-10-13 Thread Jim Fulton
Shane Hathaway wrote: > > Jim Fulton wrote: > > > > Chris Withers wrote: > > > > > > Toby Dickenson wrote: > > > > > > > > > > > > you would use > > > > > > > > def a_method(self,md): > > > > do_stuff_with(md['param1'],md['

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

2000-10-13 Thread Jim Fulton
Chris Withers wrote: > > 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 ...): > > > >

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

2000-10-13 Thread Shane Hathaway
Toby Dickenson wrote: > > > Is it *really* the case that you often want to method to be > > called directly > > via the Web *and* and from DTML? This doesn't seem right to me. > > Im suprised that you are suprised. Consider a method called 'summary' that > returns a plain-text summary of an obj

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

2000-10-13 Thread Shane Hathaway
Jim Fulton wrote: > > Chris Withers wrote: > > > > Toby Dickenson wrote: > > > > > > > > > you would use > > > > > > def a_method(self,md): > > > do_stuff_with(md['param1'],md['param2']) > > > a_method = FunctionTemplat

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 some_

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

2000-10-13 Thread Toby Dickenson
> Is it *really* the case that you often want to method to be > called directly > via the Web *and* and from DTML? This doesn't seem right to me. Im suprised that you are suprised. Consider a method called 'summary' that returns a plain-text summary of an object. Thats useful to call from DTML

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

2000-10-13 Thread Chris Withers
Toby Dickenson wrote: > > > 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 met

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

2000-10-13 Thread Jim Fulton
Chris Withers wrote: > > Toby Dickenson wrote: > > > > > > 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 d

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 dt

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 pac

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

2000-10-13 Thread Chris Withers
Toby Dickenson wrote: > > > 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

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 w

[Zope-dev] More almost __call__ ;-)

2000-10-13 Thread Chris Withers
Jim Fulton wrote: 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 the namespace, so whe