[Zope-dev] ZPatterns: SkinScript discovery

Steve Alexander steve@cat-box.net
Wed, 04 Oct 2000 15:45:11 +0100


I just found out that you can access all sorts of useful methods in
SkinScript from the magical "_" namespace variable.

Let's say I have a DataSkin that has a propertysheet "journey", which
has a "steps" property of type "lines". I can expose its "steps"
property as an attribute, and also a neatly formatted version of the
same, using this SkinScript:

WITH self.propertysheets.get('journey') COMPUTE
  steps=getProperty('steps'),
  steps_comma_sep=_.string.join(self.steps, ', ')


--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net