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
Carlos Ramos Carreño
erp5
Commits
d9ab589e
Commit
d9ab589e
authored
Feb 09, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rss_style: py3
parent
bca4306e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Listbox_asRSS.py
...TemplateItem/portal_skins/erp5_rss_style/Listbox_asRSS.py
+12
-6
No files found.
bt5/erp5_rss_style/SkinTemplateItem/portal_skins/erp5_rss_style/Listbox_asRSS.py
View file @
d9ab589e
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
publication date is entirely up to you.
publication date is entirely up to you.
"""
"""
from
Products.CMFCore.utils
import
getToolByName
import
six
from
Products.PythonScripts.standard
import
html_quote
from
Products.PythonScripts.standard
import
html_quote
items
=
[]
items
=
[]
...
@@ -72,7 +72,7 @@ for line in line_list:
...
@@ -72,7 +72,7 @@ for line in line_list:
rss_item_dict
[
header
]
=
value
rss_item_dict
[
header
]
=
value
# build xml from dict (we have to do it here because we need to manipulate tag names
# build xml from dict (we have to do it here because we need to manipulate tag names
rss_item_string
=
''
rss_item_string
=
''
for
key
,
value
in
rss_item_dict
.
items
(
):
for
key
,
value
in
six
.
iteritems
(
rss_item_dict
):
if
key
==
'pubdate'
:
if
key
==
'pubdate'
:
# pubDate should be returned unconditionally as 'pubDate'
# pubDate should be returned unconditionally as 'pubDate'
key
=
'pubDate'
key
=
'pubDate'
...
@@ -85,19 +85,25 @@ for line in line_list:
...
@@ -85,19 +85,25 @@ for line in line_list:
# if required fields not present in listbox columns as label we
# if required fields not present in listbox columns as label we
# added theirs appropriate xml dynamically
# added theirs appropriate xml dynamically
for
required_field
in
required_field_list
:
for
required_field
in
required_field_list
:
if
required_field
not
in
rss_item_dict
.
keys
()
:
if
required_field
not
in
rss_item_dict
:
field_data
=
''
field_data
=
''
if
required_field
==
'title'
:
if
required_field
==
'title'
:
if
hasattr
(
line
.
getBrain
(),
'Title'
):
if
hasattr
(
line
.
getBrain
(),
'Title'
):
field_data
=
html_quote
(
unicode
(
line
.
getBrain
().
Title
(),
'utf-8'
)
or
''
)
title
=
line
.
getBrain
().
Title
()
if
six
.
PY2
:
title
=
title
.
decode
(
'utf-8'
)
field_data
=
html_quote
(
title
or
''
)
rss_item_string
+=
(
'
\
t
\
t
\
t
<%s>%s</%s>
\
n
'
%
(
required_field
,
field_data
,
required_field
))
rss_item_string
+=
(
'
\
t
\
t
\
t
<%s>%s</%s>
\
n
'
%
(
required_field
,
field_data
,
required_field
))
elif
required_field
==
'link'
:
elif
required_field
==
'link'
:
if
hasattr
(
line
.
getBrain
(),
'absolute_url'
):
if
hasattr
(
line
.
getBrain
(),
'absolute_url'
):
field_data
=
unicode
(
line
.
getBrain
().
absolute_url
(),
'utf-8'
)
or
''
field_data
=
line
.
getBrain
().
absolute_url
(
)
or
''
rss_item_string
+=
(
'
\
t
\
t
\
t
<%s>%s</%s>
\
n
'
%
(
required_field
,
field_data
,
required_field
))
rss_item_string
+=
(
'
\
t
\
t
\
t
<%s>%s</%s>
\
n
'
%
(
required_field
,
field_data
,
required_field
))
elif
required_field
==
'description'
:
elif
required_field
==
'description'
:
if
hasattr
(
line
.
getBrain
(),
'getDescription'
):
if
hasattr
(
line
.
getBrain
(),
'getDescription'
):
field_data
=
html_quote
(
unicode
(
line
.
getBrain
().
getDescription
(),
'utf-8'
)
or
''
)
description
=
line
.
getBrain
().
getDescription
()
if
six
.
PY2
:
description
=
description
.
decode
(
'utf-8'
)
field_data
=
html_quote
(
description
or
''
)
rss_item_string
+=
(
'
\
t
\
t
\
t
<%s>%s</%s>
\
n
'
%
(
required_field
,
field_data
,
required_field
))
rss_item_string
+=
(
'
\
t
\
t
\
t
<%s>%s</%s>
\
n
'
%
(
required_field
,
field_data
,
required_field
))
items
.
append
(
rss_item_string
)
items
.
append
(
rss_item_string
)
...
...
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