def setDescription(self, description):
        """Sets the description of an inserted image"""

        if isinstance(description, str):
            description = description.decode('utf-8')
        object = IUpload(self.context)
        return object.setDescription(description)
예제 #2
0
    def setDescription(self, description):
        """Sets the description of an inserted image"""

        if isinstance(description, str):
            description = description.decode('utf-8')
        object = IUpload(self.context)
        return object.setDescription(description)
예제 #3
0
    def upload(self):
        """Upload a file to the zodb"""

        # keep diazo from touching this page
        self.request.response.setHeader('X-Theme-Disabled', 'True')
        context = IUpload(self.context)
        return context.upload()
예제 #4
0
파일: browser.py 프로젝트: CGTIC/Plone_SP
    def upload(self):
        """Upload a file to the zodb"""

        # keep diazo from touching this page
        self.request.response.setHeader('X-Theme-Disabled', 'True')
        context = IUpload(self.context)
        return context.upload()
예제 #5
0
    def test_json_upload_image(self):
        self.portal.REQUEST['uploadfile'] = self._prepare_file('common_work.jpeg', type_='image/jpeg')
        self.portal.REQUEST['uploadtitle'] = 'foobar'
        self.portal.REQUEST['uploaddescription'] = 'foo'

        obj = IUpload(self.folder_object)
        msg = obj.upload()
        self.assertTrue('resolveuid/' in msg)
예제 #6
0
    def test_json_upload_image(self):
        self.portal.REQUEST['uploadfile'] = self._prepare_file('common_work.jpeg', type_='image/jpeg')
        self.portal.REQUEST['uploadtitle'] = 'foobar'
        self.portal.REQUEST['uploaddescription'] = 'foo'

        obj = IUpload(self.folder_object)
        msg = obj.upload()
        self.assertTrue('resolveuid/' in msg)
예제 #7
0
    def test_json_upload_not_allowed(self):
        self.portal.REQUEST['uploadfile'] = self._prepare_file()
        self.portal.REQUEST['uploadtitle'] = 'foobar'
        self.portal.REQUEST['uploaddescription'] = 'foo'

        obj = IUpload(self.folder_object)
        msg = obj.upload()

        self.assertTrue('resolveuid/' in msg)
예제 #8
0
    def test_json_upload_not_allowed(self):
        self.portal.REQUEST['uploadfile'] = self._prepare_file()
        self.portal.REQUEST['uploadtitle'] = 'foobar'
        self.portal.REQUEST['uploaddescription'] = 'foo'

        obj = IUpload(self.folder_object)
        msg = obj.upload()

        self.assertTrue('resolveuid/' in msg)
    def upload(self):
        """Upload a file to the zodb"""

        context = IUpload(self.context)
        return context.upload()
예제 #10
0
    def upload(self):
        """Upload a file to the zodb"""

        context = IUpload(self.context)
        return context.upload()
예제 #11
0
    def upload(self):
        """Upload a file to the zodb"""

        object = IUpload(self.context)
        return object.upload()
예제 #12
0
파일: browser.py 프로젝트: suipnice/Jalon
    def upload(self):
        """Upload a file to the zodb"""

        #context = aq_inner(self.context)
        object = IUpload(self.context)
        return object.upload()
예제 #13
0
 def replacefile(self):
     """ Replace the binary content of a file """
     context = IUpload(self.context)
     return context.replacefile()
예제 #14
0
    def upload(self):
        """Upload a file to the zodb"""

        object = IUpload(self.context)
        return object.upload()