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
1
Merge Requests
1
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
Boxiang Sun
erp5
Commits
6866d00b
Commit
6866d00b
authored
Dec 12, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Dec 13, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[hal_json] Remove external method
parent
29457833
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
44 deletions
+6
-44
bt5/erp5_hal_json_style/ExtensionTemplateItem/portal_components/extension.erp5.HalStyle.py
...TemplateItem/portal_components/extension.erp5.HalStyle.py
+0
-10
bt5/erp5_hal_json_style/ExtensionTemplateItem/portal_components/extension.erp5.HalStyle.xml
...emplateItem/portal_components/extension.erp5.HalStyle.xml
+1
-3
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+5
-3
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Listbox_getListMethodName.xml
...l_skins/erp5_hal_json_style/Listbox_getListMethodName.xml
+0
-28
No files found.
bt5/erp5_hal_json_style/ExtensionTemplateItem/portal_components/extension.erp5.HalStyle.py
View file @
6866d00b
def
Listbox_getListMethodName
(
self
,
field
):
""" XXXX"""
list_method
=
field
.
get_value
(
'list_method'
)
try
:
list_method_name
=
getattr
(
list_method
,
'method_name'
)
except
AttributeError
:
list_method_name
=
list_method
return
list_method_name
def
Field_getSubFieldKeyDict
(
self
,
field
,
field_id
,
key
=
None
):
def
Field_getSubFieldKeyDict
(
self
,
field
,
field_id
,
key
=
None
):
"""XXX"""
"""XXX"""
return
field
.
generate_subfield_key
(
field_id
,
key
=
key
)
return
field
.
generate_subfield_key
(
field_id
,
key
=
key
)
...
...
bt5/erp5_hal_json_style/ExtensionTemplateItem/portal_components/extension.erp5.HalStyle.xml
View file @
6866d00b
...
@@ -45,9 +45,7 @@
...
@@ -45,9 +45,7 @@
<item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<value>
<tuple>
<tuple/>
<string>
W: 11, 42: Redefining built-in \'id\' (redefined-builtin)
</string>
</tuple>
</value>
</value>
</item>
</item>
<item>
<item>
...
...
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
6866d00b
...
@@ -584,7 +584,6 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
...
@@ -584,7 +584,6 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
# How to implement pagination?
# How to implement pagination?
# default_params.update(REQUEST.form)
# default_params.update(REQUEST.form)
lines
=
field
.
get_value
(
'lines'
)
lines
=
field
.
get_value
(
'lines'
)
list_method_name
=
traversed_document
.
Listbox_getListMethodName
(
field
)
list_method_query_dict
=
dict
(
list_method_query_dict
=
dict
(
portal_type
=
[
x
[
1
]
for
x
in
portal_types
],
**
default_params
portal_type
=
[
x
[
1
]
for
x
in
portal_types
],
**
default_params
)
)
...
@@ -593,8 +592,9 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
...
@@ -593,8 +592,9 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
# Search for non-editable documents - all reports goes here
# Search for non-editable documents - all reports goes here
# Reports have custom search scripts which wants parameters from the form
# Reports have custom search scripts which wants parameters from the form
# thus we introspect such parameters and try to find them in REQUEST
# thus we introspect such parameters and try to find them in REQUEST
list_method
=
None
list_method
=
field
.
get_value
(
'list_method'
)
or
None
if
list_method_name
and
list_method_name
not
in
(
"portal_catalog"
,
"searchFolder"
,
"objectValues"
):
list_method_name
=
list_method
.
getMethodName
()
if
list_method
is
not
None
else
""
if
list_method_name
not
in
(
""
,
"portal_catalog"
,
"searchFolder"
,
"objectValues"
):
# we avoid accessing known protected objects and builtin functions above
# we avoid accessing known protected objects and builtin functions above
try
:
try
:
list_method
=
getattr
(
traversed_document
,
list_method_name
)
list_method
=
getattr
(
traversed_document
,
list_method_name
)
...
@@ -603,6 +603,8 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
...
@@ -603,6 +603,8 @@ def renderField(traversed_document, field, form, value=None, meta_type=None, key
# which we will not introspect
# which we will not introspect
log
(
'ListBox {!s} list_method {} is unavailable because of "{!s}"'
.
format
(
log
(
'ListBox {!s} list_method {} is unavailable because of "{!s}"'
.
format
(
field
,
list_method_name
,
error
),
level
=
100
)
field
,
list_method_name
,
error
),
level
=
100
)
else
:
list_method
=
None
# Put all ListBox's search method params from REQUEST to `default_param_json`
# Put all ListBox's search method params from REQUEST to `default_param_json`
# because old code expects synchronous render thus having all form's values
# because old code expects synchronous render thus having all form's values
...
...
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Listbox_getListMethodName.xml
deleted
100644 → 0
View file @
29457833
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
Listbox_getListMethodName
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
HalStyle
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Listbox_getListMethodName
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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