Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
erp5
Commits
86c5ce7e
Commit
86c5ce7e
authored
Jun 28, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ImageField: support image as Pdata
parent
b229ea94
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
product/ERP5Form/ImageField.py
product/ERP5Form/ImageField.py
+2
-1
No files found.
product/ERP5Form/ImageField.py
View file @
86c5ce7e
...
@@ -31,6 +31,7 @@ from Products.Formulator import Widget, Validator
...
@@ -31,6 +31,7 @@ from Products.Formulator import Widget, Validator
from
Products.Formulator.Field
import
ZMIField
from
Products.Formulator.Field
import
ZMIField
from
Products.Formulator.DummyField
import
fields
from
Products.Formulator.DummyField
import
fields
from
OFS.Image
import
Image
as
OFSImage
from
OFS.Image
import
Image
as
OFSImage
from
OFS.Image
import
Pdata
from
lxml.etree
import
Element
from
lxml.etree
import
Element
from
lxml
import
etree
from
lxml
import
etree
import
re
import
re
...
@@ -156,7 +157,7 @@ class ImageFieldWidget(Widget.TextWidget):
...
@@ -156,7 +157,7 @@ class ImageFieldWidget(Widget.TextWidget):
# is displayed in the form as a thumbnail, it will be added in the odg
# is displayed in the form as a thumbnail, it will be added in the odg
# document as thumbnail size/quality
# document as thumbnail size/quality
content_type
,
image_data
=
image_object
.
convert
(
**
image_parameter_dict
)
content_type
,
image_data
=
image_object
.
convert
(
**
image_parameter_dict
)
if
isinstance
(
image_data
,
str
):
if
isinstance
(
image_data
,
(
basestring
,
Pdata
)
):
image
=
OFSImage
(
''
,
''
,
image_data
)
image
=
OFSImage
(
''
,
''
,
image_data
)
else
:
else
:
image
=
image_data
image
=
image_data
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment