Shane Hathaway wrote:
Here's the logic: ExternalMethod sets up func_* attributes so it can
masquerade as a function. The trick works well enough to convince
ZPublisher's mapply() to pass in a "self" argument as the first
argument when needed.
What 'self' does mapply pass? I always though it
Steve Alexander wrote:
Ah... but are you calling the external method from a DTML method? These
are all methods, and therefore you'd expect the "self" object to be the
object the methods are subobjects of.
The exact turn of events is that index_html is a DTML method which shows
a DTML
I think this is a bgu so I'll chuck it into the collector unless someone
tells me otherwise...
I have an external method called navTree (dtml-tree was too broken to
fix in the time frame :( ) with a spec as follows:
def navTree(self,start):
It's called in some DTML as:
dtml-var
Chris Withers wrote:
I think this is a bgu so I'll chuck it into the collector unless someone
tells me otherwise...
I have an external method called navTree (dtml-tree was too broken to
fix in the time frame :( ) with a spec as follows:
def navTree(self,start):
It's called in some
Steve Alexander wrote:
Chris Withers wrote:
I have an external method called navTree (dtml-tree was too broken to
fix in the time frame :( ) with a spec as follows:
def navTree(self,start):
It's called in some DTML as:
dtml-var "nav_tree(PARENTS[-2])"
which is fine, unless
Chris Withers wrote:
Shane Hathaway wrote:
that last algorithm falls to pieces. The solution is to always provide
the "self" argument.
When calling or in the signature of your external method?
Both.
Declare it like this:
def external_method(self, ...other args...):
Use it like
Steve Alexander wrote:
Both.
def external_method(self, ...other args...):
dtml-var "external_method(this(),...other args..." ?
I'll go with this advice since I still can't make heads or tails which
of the two Shane thinks I need to do ;-)
Of course, it's not documented like this. I think