How the heck do I do this Python for Loop?
This has been driving me crazy for the last week...... I wrote a python script that loops through a directory called StyleBook and selects a particular stylesheet based on the Day of the week, the year and a parameter..... --------- example: --------- ## Look for Day Year (ie - Monday 2003) in the StyleBook Directory for i in container.StyleBook.objectValues('Style Sheet'): ## Check the TITLE of "i" against a preset variable and aparameter if i.title = DAYYEAR and i.stylesheetrequest == stylesheetrequest: ### At this point I have all the variables (47 total) except the ID :( This works - I get the proper Style Sheet.... I would *like* to then call a DTML Method against the values in the NAMESPACE of the object I found in the code above..... something like return container.StyleBook.i.loadStyle() but every variation I have tried doesnt work - I get an error telling me that "i" is not in the global NameSpace.... Could someone PLEASE help me through this one? I know it is probably very simple, but it is evading me... WPH
From: http://www.zopelabs.com/cookbook/992031125 dtmlMethod(context, context.REQUEST) # of if _ is bound to the (Script) Python in the bindings tab dtmlMethod(context, _) Is that what you were looking for?
participants (2)
-
Bill Hewitt -
Chris Beaven