Message editing

Author jw
Recipients gotcha
Date 2004-09-07.10:11:28
Content
CMFPlone/TypesTool.py:

    security.declarePublic('constructContent')
    def constructContent( self
                        , type_name
                        , container
                        , id
                        , RESPONSE=None
                        , *args
                        , **kw
                        ):
        """
            Build an instance of the appropriate content
class in
            'container', using 'id'.
        """
        info = self.getTypeInfo( type_name )
        if info is None:
            raise 'ValueError', 'No such content type: %s' %
type_name

        # check we're allowed to access the type object
        if not self._checkViewType(info):
            raise Unauthorized,info

        ob = apply(info.constructInstance, (container, id) +
args, kw)

        if RESPONSE is not None:
            immediate_url = '%s/%s' % ( ob.absolute_url()
                                      , info.immediate_view )
            RESPONSE.redirect( immediate_url )
        # THIS IS THE IMPORTANT PART:
        return ob.getId()
History
Date User Action Args
2004-09-07 10:11:29jwsetrecipients: + gotcha
2004-09-07 10:11:29jwlinkissue10 messages
2004-09-07 10:11:29jwcreate