コード例 #1
0
    def _getFile(self):
        context = getattr(self.context, 'aq_explicit', self.context)
        field = context.getField(self.fieldname)

        if field is None:
            raise pNotFound(self, self.fieldname, self.request)
        if not field.checkPermission('r', context):
            raise Unauthorized()
        return field.get(context)
コード例 #2
0
    def _getFile(self):
        context = getattr(self.context, 'aq_explicit', self.context)
        field = context.getField(self.fieldname)

        if field is None:
            raise pNotFound(self, self.fieldname, self.request)
        if not field.checkPermission('r', context):
            raise Unauthorized()
        return field.get(context)
コード例 #3
0
    def publishTraverse(self, request, name):

        if self.fieldname is None:  # ../@@download/fieldname
            self.fieldname = name
        elif self.filename is None:  # ../@@download/fieldname/filename
            self.filename = name
        else:
            raise pNotFound(self, name, request)

        return self
コード例 #4
0
    def publishTraverse(self, request, name):

        if self.fieldname is None:  # ../@@download/fieldname
            self.fieldname = name
        elif self.filename is None:  # ../@@download/fieldname/filename
            self.filename = name
        else:
            raise pNotFound(self, name, request)

        return self