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
1
Issues
1
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
Roque
erp5
Commits
8c987515
Commit
8c987515
authored
Jun 26, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_hal_json_style: patch for gadget field properties
parent
f6f91be3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+11
-1
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
8c987515
...
...
@@ -409,13 +409,17 @@ def getFieldRawProperties(field, meta_type=None, key=None, key_prefix=None):
"overrides"
:
field
.
overrides
,
"message_values"
:
field
.
message_values
}
# these patchs change the field property names as are required by js rendering
form_list_patch
=
False
gadget_field_patch
=
False
for
key
in
field
.
values
.
keys
():
# sometimes, field.values returns a key as string and also as a tuple
if
type
(
key
)
is
str
:
result
[
"values"
][
key
]
=
field
.
values
[
key
]
if
key
==
"columns"
:
form_list_patch
=
True
if
key
==
"gadget_url"
:
gadget_field_patch
=
True
if
form_list_patch
:
try
:
result
[
"values"
][
"column_list"
]
=
result
[
"values"
][
"columns"
]
...
...
@@ -427,8 +431,14 @@ def getFieldRawProperties(field, meta_type=None, key=None, key_prefix=None):
query
=
"portal_type%3A%22"
+
portal_type
+
"%22"
if
portal_type
else
""
full_query
=
"urn:jio:allDocs?query="
+
query
result
[
"values"
][
"query"
]
=
full_query
except
:
except
KeyError
:
log
(
"error while patching form list definition"
)
if
gadget_field_patch
:
try
:
result
[
"values"
][
"url"
]
=
result
[
"values"
][
"gadget_url"
]
result
[
"values"
][
"renderjs_extra"
]
=
result
[
"values"
][
"renderjs_extra"
][
0
][
0
]
except
KeyError
:
log
(
"error while patching form gadget list definition"
)
for
key
in
field
.
tales
.
keys
():
if
field
.
tales
[
key
]:
result
[
"tales"
][
key
]
=
str
(
field
.
tales
[
key
])
...
...
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