|
|
Workflow Scripts and Acq follow up / jamesr <circlecycle@gmail.com>
Workflow Scripts and Acq follow up
jamesr <circlecycle(at)gmail.com> |
2005-09-09 14:44:34 |
[
FULL ]
|
This little piece of code will work for me, but what am I missing
here?! this isn't as pretty..
currObj = state_change.object
while currObj.meta_type != 'Plone Site':
if currObj.getProperty('SafeHouseBase',None) != None:
raise "Found it."
currObj = currObj.aq_parent
|
Re: [ZPUGDC] Workflow Scripts and Acquistion / Joel Burton <joel@joelburton.com>
Re: [ZPUGDC] Workflow Scripts and Acquistion
Joel Burton <joel(at)joelburton.com> |
2005-09-09 15:32:18 |
[
FULL ]
|
On Friday 09 September 2005 12:45 pm, jamesr wrote:[...]
Take a gander at the code for getProperty--it only returns the property is the
object in question has it (via hasProperty); it doesn't normally aquire
upwards.
You could do the aq_parent trick, but, much more sensible is just:
state_change.object.SafeHouseBase
or, should you want to cover your butt:
getattr(state_change.object, 'SafeHouseBase', None)
This will acquire just fine and the puppies and the rainbows will dance
happily and merrily and all will be well with public sanitation.
Best,
- j.
|
Re: [ZPUGDC] Workflow Scripts and Acquistion / jamesr <circlecycle@gmail.com>
Re: [ZPUGDC] Workflow Scripts and Acquistion
jamesr <circlecycle(at)gmail.com> |
2005-09-09 16:20:12 |
[
FULL ]
|
Thanks Joel! Mental block on that one :)
if it sparks interest for anyone,
I'm working on a unusual workflow that will 'mirror' a folder's public
documents, so that a 'toplevel' folder will have, and only have, public
documents. When the state is changed to public on a folder for members
internally to the site, it is copied to the appropiate folder on top (a
SafeHouseBase/SafeHouseMirror property pair says which folders are
mirrored to which.) Private and Update transitions compliment it. This
makes auditing a breeze for users regardless of plone experience, which
the client likes. This way work directories are never accessed by the
anonymous public to view public materials. If SafeHouseBase isn't
defined on the internal work folder, none of this happens. Either way,
users aren't confused maintaining multiple folders.
fyi.
|
|
|
|