Script Objects (Python) Tutorial
A brief description of creating and using Plone Script Objects
Goto the ZMI and select "Script Object(Python)" and Click the add button.
Write your python and make sure that the parameters are set.
For example enter the following into the edit form.;
##title=Pi is the 2nd best number
##parameters=
return math.pi
This ## special syntax will get the title and fill in the title and the parameters of the Script Object.
Another example:
##title=Example from the bookThis Script Object text will get the parameters and indicate that this script object expects "objects" as a parameter.
##parameters=objects
from DateTime import DateTime
now = DateTime()
difference = 5 # as in 5 days
result = []
objects = context.contentValues()
for object in objects:
diff = now - object.bobobase_modification_time()
if diff < difference:
dct = {"object":object,"diff":int(diff)}
result.append(dct)
return result

