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
Thomas Gambier
erp5
Commits
f1bbc5aa
Commit
f1bbc5aa
authored
Mar 14, 2019
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_trade: drop caching method for resource list
benefit is very small and unusable for user
nexedi/erp5@1f254aa7
parent
213974eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
23 deletions
+12
-23
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getResourceItemList.py
...m/portal_skins/erp5_trade/Delivery_getResourceItemList.py
+12
-23
No files found.
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getResourceItemList.py
View file @
f1bbc5aa
...
@@ -41,30 +41,19 @@ if len(sql_kw) == 0:
...
@@ -41,30 +41,19 @@ if len(sql_kw) == 0:
except
AttributeError
:
except
AttributeError
:
pass
pass
def
getResourceItemList
(
sql_kw
):
portal
=
context
.
getPortalObject
()
result
=
[]
for
resource
in
portal
.
portal_catalog
.
searchResults
(
sort_on
=
((
'portal_type'
,
'asc'
),
(
'title'
,
'asc'
)),
**
sql_kw
):
result
.
append
(
(
resource
.
getTitle
(),
resource
.
getRelativeUrl
()))
result
.
append
((
''
,
''
))
return
result
sql_kw
[
'portal_type'
]
=
portal_type
sql_kw
[
'portal_type'
]
=
portal_type
sql_kw
[
'validation_state'
]
=
validation_state
sql_kw
[
'validation_state'
]
=
validation_state
sql_kw
[
'default_use_uid'
]
=
[
context
.
portal_categories
.
resolveCategory
(
use
).
getUid
()
sql_kw
[
'default_use_uid'
]
=
[
context
.
portal_categories
.
resolveCategory
(
use
).
getUid
()
for
use
in
use_list
]
for
use
in
use_list
]
sql_kw
[
'limit'
]
=
20
getResourceItemList
=
CachingMethod
(
getResourceItemList
,
(
"getResourceItemList"
,
context
.
aq_parent
.
getId
()),
result
=
[]
cache_factory
=
"erp5_ui_short"
)
for
resource
in
portal
.
portal_catalog
.
searchResults
(
sort_on
=
((
'portal_type'
,
'asc'
),
(
'title'
,
'asc'
)),
**
sql_kw
):
return
getResourceItemList
(
sql_kw
)
result
.
append
(
(
resource
.
getTitle
(),
resource
.
getRelativeUrl
()))
result
.
append
((
''
,
''
))
return
result
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