[Zope] Python Script HowTo (WAS: How do I get the value of an object with python?)

Bill Hewitt wphewitt at comcast.net
Mon Aug 25 18:25:56 EDT 2003


Hi
First it's great to be back on the list..... Had some problems for a few
days.


As Dieter pointed out I was not very clear in what I was trying to
accomplish. (All my posts to this point have been related - as well as
the post by davis at mccalldesign.com - which seems very similar...)

Heres what I have:
2 ZClasses

StyleBook (Inherits from Folder)
    |
    |
    |
    |---StyleSheet (Inherits from DTML Document)
        Unique title Property specifying when to use
        styletype Property specifying where to use

At this point I can successfully create the StyleBook instance and add
StyleSheet instances with the correct properties and through the ZMI,
reset and/or view the results of those properties at will.....

Now, I am trying to:

* Via Python, collect all instances of StyleSheet that exist in
StyleBook (via unique object ID)

* Via Python, look at the title and styletype properties of each
StyleSheet instance and compare them against my query arguments

* If I find a match, return all the Property values(potentially 47+) of
the particular StyleSheet instance (that are not empty strings) in a CSS
Format.

I cannot find any good *simple* howto examples of doing this with
python. (With DTML I can do it, but it is very messy... Though I'm just
learning Python, I would like to do it with python)

Hope this makes sense......and Thanks for listening


WPH





More information about the Zope mailing list