diff options
| author | Xavier Morel <xmo@openerp.com> | 2014-03-03 16:38:55 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2014-03-03 16:38:55 +0100 |
| commit | a99a15c9607cfede384a86736cc4f81ab24e841a (patch) | |
| tree | 5de3dd061b84617a4e2ae53ed5773694faa2d340 /addons/website/static/src/xml/website.editor.xml | |
| parent | ec68d3d8bd13e84cd742e849c4ac602805a5d4c3 (diff) | |
[ADD] deduplication of website images being uploaded
There is a deduplication in ir.attachment, but it's only for FS-stored content
*and* it only deduplicates storage not models (as there are access rights
issues involved).
The goal here is to always return the same attachment when a user uploads the
exact same image multiple times (because it's simpler or whatever).
Initially tried to use a binary field & digest(), but search() blows up
because it tries to utf-8 encode raw binary data. So use char & hexdigest
instead.
_compute_checksum returns None if the provided attachment data does not look
like a website image attachment.
Unhandled: multiple existing matches, maybe a UNIQUE constraint on the
checksum field would be a good idea just in case.
bzr revid: xmo@openerp.com-20140303153855-5f2l8v0jq2mgb26f
Diffstat (limited to 'addons/website/static/src/xml/website.editor.xml')
0 files changed, 0 insertions, 0 deletions
