Jorg E. Rødsjø writes:
I have an external method(python):
def makePhoneList(searchString, *sortBy):
Then I want to be able to call it in a dtml-document like so (wrong, I know, but to illustrate what I am looing for).
<dtml-in expr="makePhoneList(searchString='foo', '<dtml-var sortBy1>', '<dtml-var sortBy2>')">
The sortBy1 and sortBy2 are variables in the DTML-document.
<dtml-in expr="makePhoneList(searchString='foo', sortBy1, sortBy2)"> will be fine.
But I am having problems with the arguments. Possibly due to the fact that my function specifies *sortBy as a list of parameters. Probably not.
"*sortBy" in your function definition accepts a (potentially empty) sequence of values. "sortBy" is a tuple in your function.
Any suggestions would be appreciated. You, probably, should think about some background reading (Zope Book, Python documentation).
Dieter