[Zope] Using string.split() on a DTML method
Oscar Picasso
picasso@videotron.ca
Sat, 09 Oct 1999 23:28:54 -0400
Try this, I think it should work:
<dtml-with "_.namespace(var1=_.string.split(_['category_list_cookie'], ':'))">
Often replacing name_of_my_variable by _['name_of_my_variable'] produce
better results.
I even don't know why in this case and I gave up trying to find the reasons
until I can get a good documentation explaning how and why things work in
Zope.
An idea: there are about 1500 members in zope.org. If everyone gives $200
the total is $300 000. For that amount I think we could find a good team of
writers that could quickly write real good and complete documentation not
only targeted to top gun programmers in Zope.
What do you think about that? If DC could also give its opinion. For my
part I would give up to $400 just for that.
Open source doesn't mean poor documentation. Look at Python. I know that
everybody involved in Zope development does the best he can as I can see
when I receive answers to my questions.
At 21:04 99-10-09 -0400, Jim Cain wrote:
>I have a DTML method, category_list_cookie, which returns a string of
>colon-separated values I use elsewhere. I would like to split this into a
>list so I can use something like phred.count('whatever') to see if this
>value is present.
>
>However, when I do something like:
>
><dtml-with "_.namespace(var1=_.string.split(category_list_cookie, ':'))">
>
>I get this error:
>
>Error Type: TypeError
>Error Value: argument 1: expected read-only character buffer,
>ImplicitAcquirerWrapper found
>
>
>Even with something like this:
>
><dtml-with "_.namespace(var1=category_list_cookie)">
><dtml-call "REQUEST.set('var2', _.string.split(var1, ':'))">
>
>the split method gives the same error. Is var1 in the second example merely
>a reference to category_list_cookie, so that I get the same error? Whether
>or not this is the case, what does the error mean and how do I fix it?
>
>
>Cheers,
>Jim
>
******************************************************
Oscar Picasso
picasso@videotron.ca
******************************************************