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
Paul Graydon
erp5
Commits
808750c2
Commit
808750c2
authored
Feb 09, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RSS: py3
parent
3df59caf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
13 deletions
+15
-13
bt5/erp5_km/TestTemplateItem/portal_components/test.erp5.testKM.py
...km/TestTemplateItem/portal_components/test.erp5.testKM.py
+14
-12
bt5/erp5_knowledge_pad/ExtensionTemplateItem/portal_components/extension.erp5.GetRssDataAsDict.py
...Item/portal_components/extension.erp5.GetRssDataAsDict.py
+1
-1
No files found.
bt5/erp5_km/TestTemplateItem/portal_components/test.erp5.testKM.py
View file @
808750c2
...
@@ -592,37 +592,39 @@ class TestKM(TestKMMixIn):
...
@@ -592,37 +592,39 @@ class TestKM(TestKMMixIn):
uids
=
[
km_latest_documents_gadget
.
getUid
()])
uids
=
[
km_latest_documents_gadget
.
getUid
()])
# "Latest Content" gadget
# "Latest Content" gadget
gadget_view_form_id
=
km_latest_documents_gadget
.
view_form_id
gadget_view_form_id
=
km_latest_documents_gadget
.
view_form_id
publication_section_category_id_list
=
[
'documentation'
,
'administration'
]
publication_section_category_id_list
=
[
'documentation'
,
'administration'
]
for
category_id
in
publication_section_category_id_list
:
for
category_id
in
publication_section_category_id_list
:
portal
.
portal_categories
.
publication_section
.
newContent
(
portal_type
=
'Category'
,
if
category_id
not
in
portal
.
portal_categories
.
publication_section
.
objectIds
():
id
=
category_id
)
portal
.
portal_categories
.
publication_section
.
newContent
(
portal_type
=
'Category'
,
id
=
category_id
)
latest_docs_subsection
=
self
.
websection
.
newContent
(
portal_type
=
'Web Section'
)
latest_docs_subsection
=
self
.
websection
.
newContent
(
portal_type
=
'Web Section'
)
latest_docs_subsection
.
edit
(
membership_criterion_base_category
=
[
'publication_section'
],
latest_docs_subsection
.
edit
(
membership_criterion_base_category
=
[
'publication_section'
],
membership_criterion_category
=
[
'publication_section/%s'
membership_criterion_category
=
[
'publication_section/%s'
%
publication_section_category_id_list
[
0
]])
%
publication_section_category_id_list
[
0
]])
self
.
tic
()
self
.
tic
()
km_latest_documents_gadget_box_url
=
_getGadgetInstanceUrlFromKnowledgePad
(
km_latest_documents_gadget_box_url
=
_getGadgetInstanceUrlFromKnowledgePad
(
self
.
web_section_knowledge_pad
,
self
.
web_section_knowledge_pad
,
km_latest_documents_gadget
)
km_latest_documents_gadget
)
self
.
changeSkin
(
'KM'
)
self
.
changeSkin
(
'KM'
)
# set here to prevent failing to render a form's field which reads directly requets
# set here to prevent failing to render a form's field which reads directly requets
request
.
set
(
'box_relative_url'
,
km_latest_documents_gadget_box_url
)
request
.
set
(
'box_relative_url'
,
km_latest_documents_gadget_box_url
)
# add some documents to this web section
# add some documents to this web section
presentation
=
portal
.
document_module
.
newContent
(
presentation
=
portal
.
document_module
.
newContent
(
title
=
'My presentation'
,
title
=
'My presentation'
,
portal_type
=
'Presentation'
,
portal_type
=
'Presentation'
,
reference
=
'Presentation-12456_'
,
reference
=
'Presentation-12456_'
,
version
=
'001'
,
version
=
'001'
,
language
=
'en'
,
language
=
'en'
,
publication_section_list
=
publication_section_category_id_list
[:
1
])
publication_section_list
=
publication_section_category_id_list
[:
1
])
presentation
.
publish
()
presentation
.
publish
()
self
.
tic
()
self
.
tic
()
self
.
changeSkin
(
'KM'
)
self
.
changeSkin
(
'KM'
)
self
.
assertIn
(
presentation
.
getTitle
().
encode
(),
self
.
assertIn
(
presentation
.
getTitle
().
encode
(),
self
.
publish
(
self
.
base_url_pattern
self
.
publish
(
self
.
base_url_pattern
%
%
(
self
.
web_section_url
+
'/%s'
%
latest_docs_subsection
.
getId
(),
(
self
.
web_section_url
+
'/%s'
%
latest_docs_subsection
.
getId
(),
gadget_view_form_id
,
gadget_view_form_id
,
latest_docs_subsection
.
getRelativeUrl
(),
latest_docs_subsection
.
getRelativeUrl
(),
km_latest_documents_gadget_box_url
)
km_latest_documents_gadget_box_url
)
...
...
bt5/erp5_knowledge_pad/ExtensionTemplateItem/portal_components/extension.erp5.GetRssDataAsDict.py
View file @
808750c2
...
@@ -58,7 +58,7 @@ def getRssDataAsDict(context, url, username=None, password=None):
...
@@ -58,7 +58,7 @@ def getRssDataAsDict(context, url, username=None, password=None):
entry_dict
[
'updated_parsed'
]
=
entry
.
get
(
'updated_parsed'
,
None
)
entry_dict
[
'updated_parsed'
]
=
entry
.
get
(
'updated_parsed'
,
None
)
result
[
'items'
].
append
(
entry_dict
)
result
[
'items'
].
append
(
entry_dict
)
# sort by date
# sort by date
result
[
'items'
]
=
sorted
(
result
[
'items'
],
key
=
lambda
k
:
k
[
'updated_parsed'
])
result
[
'items'
]
=
sorted
(
result
[
'items'
],
key
=
lambda
k
:
k
[
'updated_parsed'
]
or
()
)
result
[
'items'
].
reverse
()
result
[
'items'
].
reverse
()
result
[
'status'
]
=
0
result
[
'status'
]
=
0
return
result
return
result
\ No newline at end of file
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