Message editing

Author jw
Recipients gotcha
Date 2004-09-07.10:12:09
Content
CMFPlone/Portal.py

    # Override CMFCore's invokeFactory to return the id
returned by the
    # factory in case the factory modifies the id
   
security.declareProtected(CMFCorePermissions.AddPortalContent,
'invokeFactory')
    def invokeFactory( self
                     , type_name
                     , id
                     , RESPONSE=None
                     , *args
                     , **kw
                     ):
        '''Invokes the portal_types tool.'''
        pt = getToolByName( self, 'portal_types' )
        myType = pt.getTypeInfo(self)

        if myType is not None:
            if not myType.allowType( type_name ):
                raise ValueError, 'Disallowed subobject
type: %s' % type_name

        args = (type_name, self, id, RESPONSE) + args
        new_id = pt.constructContent(*args, **kw)
        if new_id is None or new_id == '':
            new_id = id
        return new_id
History
Date User Action Args
2004-09-07 10:12:09jwsetrecipients: + gotcha
2004-09-07 10:12:09jwlinkissue10 messages
2004-09-07 10:12:09jwcreate