Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
0436c8e4
Commit
0436c8e4
authored
Oct 03, 2017
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bt5_config: Add function to get erp5 object from its JSON representation
parent
0f9d1983
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
product/ERP5Type/mixin/json_representable.py
product/ERP5Type/mixin/json_representable.py
+8
-2
No files found.
product/ERP5Type/mixin/json_representable.py
View file @
0436c8e4
...
...
@@ -74,10 +74,16 @@ class JSONRepresentableMixin:
xml_value
=
f
.
getvalue
()
return
xmltodict
.
parse
(
xml_value
)
def
fromJSON
(
self
):
def
fromJSON
(
self
,
val
):
"""
Updates an object, based on a JSON representation
"""
pass
dict_value
=
json
.
loads
(
val
)
# Convert the dict_value to XML representation
xml_value
=
xmltodict
.
unparse
(
dict_value
)
f
=
StringIO
(
xml_value
)
return
XMLExportImport
.
importXML
(
self
.
_p_jar
,
f
)
InitializeClass
(
JSONRepresentableMixin
)
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