[Zope-CMF] Right way to do Edit in Python product?

Jon Edwards jon@pcgs.freeserve.co.uk
Tue, 23 Apr 2002 12:39:44 +0100


Looking through CMF Default (CMF 1.2), there seems to be two different ways
Edit is handled in different modules. Can anyone tell me which is the right
way, or best practice?
-------------------------------------------------------------
1. e.g. File.py

def edit(.....):
    Do editing stuff
edit = WorkflowAction(edit)
-------------------------------------------------------------------
2. e.g. Link.py

security.declarePrivate( '_edit' )
def _edit( self, remote_url ):
    Do editing stuff

security.declareProtected( CMFCorePermissions.ModifyPortalContent, 'edit' )
edit = WorkflowAction( _edit )
--------------------------------------------------------------------

I'm guessing that method 2 would be better, as it includes security
declarations?

Cheers, Jon