[Zope] stupid, but neccessary q'n

Tres Seaver tseaver@palladion.com
Wed, 23 Feb 2000 14:42:08 -0600


Tom Deprez <tom.deprez@uz.kuleuven.ac.be> asked:
> 
> When Adding properties to a ZClass, I came across the type Token.
> 
> What does this mean?
 

Geir B Hansen <geirh@funcom.com> replied:
>
> I wondered about this for a while too, but i think found out in
> the end .
> 
> a 'tokens'-field is like a 'lines'-field
> except the values are comma-separated instead of
> newline-separated..
> 
> like this :
> 
> item1,item2,item3 etc..

Almost -- it is space-delimited, not comma-delimited:

  "item1 item2 item3"

The clincher is the implementation, in
 $ZOPE_HOME/lib/python/ZPublisher/Converters.py::

  def field2tokens(v):
      if hasattr(v,'read'): v=v.read()
      else: v=str(v)
      return split(v) # this is Python's string.split()

-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com