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):
...
@@ -409,13 +409,17 @@ def getFieldRawProperties(field, meta_type=None, key=None, key_prefix=None):
"overrides"
:
field
.
overrides
,
"overrides"
:
field
.
overrides
,
"message_values"
:
field
.
message_values
"message_values"
:
field
.
message_values
}
}
# these patchs change the field property names as are required by js rendering
form_list_patch
=
False
form_list_patch
=
False
gadget_field_patch
=
False
for
key
in
field
.
values
.
keys
():
for
key
in
field
.
values
.
keys
():
# sometimes, field.values returns a key as string and also as a tuple
# sometimes, field.values returns a key as string and also as a tuple
if
type
(
key
)
is
str
:
if
type
(
key
)
is
str
:
result
[
"values"
][
key
]
=
field
.
values
[
key
]
result
[
"values"
][
key
]
=
field
.
values
[
key
]
if
key
==
"columns"
:
if
key
==
"columns"
:
form_list_patch
=
True
form_list_patch
=
True
if
key
==
"gadget_url"
:
gadget_field_patch
=
True
if
form_list_patch
:
if
form_list_patch
:
try
:
try
:
result
[
"values"
][
"column_list"
]
=
result
[
"values"
][
"columns"
]
result
[
"values"
][
"column_list"
]
=
result
[
"values"
][
"columns"
]
...
@@ -427,8 +431,14 @@ def getFieldRawProperties(field, meta_type=None, key=None, key_prefix=None):
...
@@ -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
""
query
=
"portal_type%3A%22"
+
portal_type
+
"%22"
if
portal_type
else
""
full_query
=
"urn:jio:allDocs?query="
+
query
full_query
=
"urn:jio:allDocs?query="
+
query
result
[
"values"
][
"query"
]
=
full_query
result
[
"values"
][
"query"
]
=
full_query
except
:
except
KeyError
:
log
(
"error while patching form list definition"
)
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
():
for
key
in
field
.
tales
.
keys
():
if
field
.
tales
[
key
]:
if
field
.
tales
[
key
]:
result
[
"tales"
][
key
]
=
str
(
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