def uploader_post(req): loc = location(req) fin = req.POST['file'] mimetype = guess_type(fin.filename)[0] contents = fin.file.read() message = req.POST.get('svenweb.commit_message') return (contents, message, mimetype, exc.HTTPSeeOther(location=loc))
def post(self, request): """ return response to a POST request """ contents = request.POST.get('svenweb.resource_body') message = request.POST.get('svenweb.commit_message') metadata = {} loc = location(request) return (contents, message, metadata, exc.HTTPSeeOther(location=loc))
def convert(self, request): assert False content = request.POST.get('svenweb.resource_body') mimetype = request.POST.get('svenweb.mimetype') _from = request.POST['convert_from'] message = request.POST.get('svenweb.commit_message') loc = location(request) return (convert(_from, mimetype, content), message, {'mimetype':mimetype}, exc.HTTPSeeOther(location=loc))
def convert(self, request): assert False content = request.POST.get('svenweb.resource_body') mimetype = request.POST.get('svenweb.mimetype') _from = request.POST['convert_from'] message = request.POST.get('svenweb.commit_message') loc = location(request) return (convert(_from, mimetype, content), message, { 'mimetype': mimetype }, exc.HTTPSeeOther(location=loc))