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
amrani
erp5
Commits
c4641821
Commit
c4641821
authored
Feb 13, 2018
by
Xiaowu Zhang
Committed by
Ayush Tiwari
Mar 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hal_json_style&listbox: check if key is an object path
parent
5d770137
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
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
+6
-0
product/ERP5Form/ListBox.py
product/ERP5Form/ListBox.py
+5
-1
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
c4641821
...
@@ -1804,6 +1804,12 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
...
@@ -1804,6 +1804,12 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
else
:
else
:
contents_item
[
select
][
key
]
=
url_parameter_dict
[
select
][
key
]
contents_item
[
select
][
key
]
=
url_parameter_dict
[
select
][
key
]
if
'jio_key'
in
contents_item
[
select
]:
try
:
portal
.
restrictedTraverse
(
contents_item
[
select
][
'jio_key'
])
except
KeyError
:
contents_item
[
select
][
'jio_key'
]
=
traversed_document
.
getRelativeUrl
()
+
'/'
+
contents_item
[
select
][
'jio_key'
]
if
'jio_key'
not
in
contents_item
[
select
]
and
url_parameter_dict
[
select
]
and
'absolute_url'
not
in
contents_item
[
select
]:
if
'jio_key'
not
in
contents_item
[
select
]
and
url_parameter_dict
[
select
]
and
'absolute_url'
not
in
contents_item
[
select
]:
contents_item
[
select
][
'jio_key'
]
=
traversed_document
.
getRelativeUrl
()
contents_item
[
select
][
'jio_key'
]
=
traversed_document
.
getRelativeUrl
()
...
...
product/ERP5Form/ListBox.py
View file @
c4641821
...
@@ -2348,7 +2348,11 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
...
@@ -2348,7 +2348,11 @@ class ListBoxHTMLRendererLine(ListBoxRendererLine):
if
'jio_key'
not
in
result_dict
:
if
'jio_key'
not
in
result_dict
:
url
=
''
url
=
''
else
:
else
:
url
=
self
.
getObject
().
getPortalObject
().
restrictedTraverse
(
result_dict
[
'jio_key'
]).
absolute_url
()
try
:
url
=
self
.
getObject
().
getPortalObject
().
restrictedTraverse
(
result_dict
[
'jio_key'
]).
absolute_url
()
except
KeyError
:
url
=
result_dict
[
'jio_key'
]
if
'view_action'
in
result_dict
:
if
'view_action'
in
result_dict
:
url
+=
result_dict
[
'view_action'
]
url
+=
result_dict
[
'view_action'
]
if
'parameter'
not
in
result_dict
and
getattr
(
brain
,
'getListItemParamDict'
,
None
)
is
not
None
:
if
'parameter'
not
in
result_dict
and
getattr
(
brain
,
'getListItemParamDict'
,
None
)
is
not
None
:
...
...
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