-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
static_file | ||
:copyright: (c) 2015 by Fulfil.IO Inc. | ||
:license: see LICENSE for details. | ||
""" | ||
import os | ||
from trytond.pool import PoolMeta | ||
|
||
__all__ = ['NereidStaticFile'] | ||
__metaclass__ = PoolMeta | ||
|
||
|
||
class NereidStaticFile: | ||
"Static files for Nereid" | ||
__name__ = "nereid.static.file" | ||
|
||
def _set_file_binary(self, value): | ||
""" | ||
Setter for static file that stores file in file system | ||
:param value: The value to set | ||
""" | ||
if self.name == 'no-product-image.png' and \ | ||
value == 'binary-default-image': | ||
# XXX: This is default webshop image that need to be replaced | ||
# by binary content of product no image. Ugly hack ;) | ||
# Can't find provision to store binary file in xml. | ||
value = open(os.path.join( | ||
os.path.dirname(__file__), 'static/images/no-product-image.png' | ||
)).read() | ||
super(NereidStaticFile, self)._set_file_binary(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[tryton] | ||
version=3.4.3.1 | ||
version=3.4.4.0 | ||
depends: | ||
nereid | ||
nereid_cms | ||
|