首页 \ 问答 \ 如何让Odoo 9使用S3存储桶来存储二进制文件?(How to make Odoo 9 use an S3 bucket to store binary files?)

如何让Odoo 9使用S3存储桶来存储二进制文件?(How to make Odoo 9 use an S3 bucket to store binary files?)

我在EC2上运行了一个Odoo实例(版本9)。 Postgres数据库在RDS上运行,据我所知,二进制文件不存储在数据库中,而是存储在运行Web服务器的实例的文件系统中。

如何调整Odoo 9以便它使用S3存储桶进行文件存储(而不是文件系统)?


I've got an Odoo instance (version 9) running on EC2. The Postgres database runs on RDS and, as far as I understand, binary files are not stored in the db but rather on the file system of the instance running the web server.

How can I tweak Odoo 9 so that it uses an S3 bucket for files storage (instead of the file system)?


原文:https://stackoverflow.com/questions/38805733
更新时间:2023-10-18 20:10

最满意答案

根据您之前的问题,我假设图像视图是此自定义视图对象的子视图。 您需要在此类中维护可变数组的路径。 在touchesBegan:withEvent:初始化它,并关闭touchesEnded:withEvent:的路径。 将路径推入阵列。 在每个触摸事件(开始,移动,结束)时,调用一个方法,在将触摸点添加到路径后更新图像视图的图像。

更新图像将涉及创建空图像上下文,然后在触摸它们时迭代阵列中的所有路径和当前路径。 完成绘制后,从上下文生成图像对象并将其设置为图像。 在我们注意到每条路径的属性可能不同之前,我们会非常直截了当 要处理这个问题,你应该为路径创建一个容器类,它将保存路径的属性。 将此类的对象推送到数组中的每个路径而不是路径本身。 这样您就可以维护视图的状态。


Based on your earlier question, I am assuming that the image view is a subview of this custom view object. You will need to maintain a mutable array of paths in this class. Initialize it at touchesBegan:withEvent: and close the path at touchesEnded:withEvent:. Push the path into the array. At every touch event (began, moved, ended), call a method that updates the image view's image after adding the touch point to the path.

Updating the image will involve creating an empty image context and then iterating over all paths in your array and the current path while stroking them. Once you're done drawing, generate the image object from the context and set it to the image. Pretty straightforward until we notice that each path might differ in attributes. To deal with this you should create a container class for the path which will hold the attributes about the path. Push an object of this class for every path into the array rather than the path itself. This way you can maintain state for your view.

相关问答

更多
  • 有一个开源项目,这对你很有用。iOS-Scratch-n-See 。 ImageMaskView类将是有趣的研究。 希望有所帮助! There is an open source project which will be useful for you .. iOS-Scratch-n-See. Class ImageMaskView will be interesting to study. Hope that helps!
  • 如果要将图像发送到服务器。 发送它的唯一方法是将UIImage转换为NSData 。 NSData *imageData= UIImageJPEGRepresentation(image,0.0); NSData *imageData = UIImagePNGRepresentation(image); If you want to send image to server. The only way to send it is by converting the UIImage to NSData . ...
  • 在我看来,你没有为图像选择器设置委托,例如: [imagePickerController setDelegate:self]; 我想那将是你的takePicture方法。 It seems to me that you're not setting the delegate for the image picker, For instance: [imagePickerController setDelegate:self]; I think that would be in your takePictu ...
  • 根据您之前的问题,我假设图像视图是此自定义视图对象的子视图。 您需要在此类中维护可变数组的路径。 在touchesBegan:withEvent:初始化它,并关闭touchesEnded:withEvent:的路径。 将路径推入阵列。 在每个触摸事件(开始,移动,结束)时,调用一个方法,在将触摸点添加到路径后更新图像视图的图像。 更新图像将涉及创建空图像上下文,然后在触摸它们时迭代阵列中的所有路径和当前路径。 完成绘制后,从上下文生成图像对象并将其设置为图像。 在我们注意到每条路径的属性可能不同之前,我们会 ...
  • 为了得到一个真实的,完全充实的答案,这里基本上是你需要的。 let consume = 0.25 let x = self.frame.size.width / 2.0 let y = self.frame.size.height / 2.0 let radius = (frame.size.width - 10) / 2.0 let startAngle: CGFloat = CGFloat(M_PI * (-1/2)) let endAngle = CGFloat(M_PI * 2 - M_PI/2 * ...
  • 你做的工作超出了你的需要。 在调用UIGraphicsBeginImageContextWithOptions()之前调用[path addClip]会导致“无效上下文”消息。 UIBezierPath尝试访问线程的当前图形上下文,但尚未设置。 这是获得相同结果的更简单方法。 请注意,您根本不需要使用CGContext 。 UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0.0); UIBezierPath *path = [UIBezierPa ...
  • CGContextSetFillColorWithColor:无效的上下文0x0。 这意味着您在没有有效绘图上下文的情况下尝试进行核心图形绘制操作。 0x0是nil 。 每当您尝试在没有当前图形上下文时填充或描边路径时,您将获得此输出。 你自己制作一个当前的图形上下文,它可以用于在屏幕外绘制图像,或者当UIKit创建一个时,它会在它调用draw(_ rect:)之前完成draw(_ rect:) 你setProgress()在draw(_ rect:)调用setProgress() ,在这种情况下你的绘图会 ...
  • 我走了一个不同的方向。 我没有使用PNG,而是使用SVG并使用PocketSVG来解析文件。 它很棒。 I went a different direction. Instead of using PNGs I went with SVG and used PocketSVG to parse the file. It works great.
  • 我发现了一个演示代码.. 请检查一下它是否对您有所帮助.. 平滑线链接 I found one demo code for that.. Please check this if it will be helpful to you.. Smooth Line link
  • 您在转换之前绘制路径(使用stroke )。 路径只是一种数学表示。 这不是“在屏幕上”的界限。 您无法通过修改有关它的数据来移动您已绘制的内容。 只需将[aPath stroke]移出pathFrom:to:并将其放在applyTransform: 。 You're drawing the path (with stroke) before you transform it. A path is just a mathematical representation. It isn't the line " ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)