Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
96cb3faa
Commit
96cb3faa
authored
Jun 10, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 'reverse' attribute to the In tag.
parent
09a53f7b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
lib/python/DocumentTemplate/DT_In.py
lib/python/DocumentTemplate/DT_In.py
+13
-3
No files found.
lib/python/DocumentTemplate/DT_In.py
View file @
96cb3faa
...
...
@@ -124,6 +124,8 @@
sort -- Define the sort order for sequence items. If an item in
the sequence does not define
reverse -- Reverse the sequence (may be combined with sort).
Within an 'in' block, variables are substituted from the
elements of the iteration. The elements may be either
instance or mapping objects. In addition, the variables:
...
...
@@ -379,8 +381,8 @@
'''
#'
__rcs_id__
=
'$Id: DT_In.py,v 1.3
4 1999/04/30 18:28:57 jim
Exp $'
__version__
=
'$Revision: 1.3
4
$'
[
11
:
-
2
]
__rcs_id__
=
'$Id: DT_In.py,v 1.3
5 1999/06/10 15:02:55 brian
Exp $'
__version__
=
'$Revision: 1.3
5
$'
[
11
:
-
2
]
from
DT_Util
import
ParseError
,
parse_params
,
name_param
,
str
from
DT_Util
import
render_blocks
,
InstanceDict
,
ValidationError
...
...
@@ -410,7 +412,8 @@ class InClass:
args
=
parse_params
(
args
,
name
=
''
,
start
=
'1'
,
end
=
'-1'
,
size
=
'10'
,
orphan
=
'3'
,
overlap
=
'1'
,
mapping
=
1
,
skip_unauthorized
=
1
,
previous
=
1
,
next
=
1
,
expr
=
''
,
sort
=
''
)
previous
=
1
,
next
=
1
,
expr
=
''
,
sort
=
''
,
reverse
=
0
)
self
.
args
=
args
has_key
=
args
.
has_key
...
...
@@ -418,6 +421,11 @@ class InClass:
self
.
sort
=
sort
=
args
[
'sort'
]
if
sort
==
'sequence-item'
:
self
.
sort
=
''
if
has_key
(
'reverse'
):
self
.
reverse
=
1
self
.
sort
=
''
else
:
self
.
reverse
=
0
if
has_key
(
'mapping'
):
self
.
mapping
=
args
[
'mapping'
]
for
n
in
'start'
,
'size'
,
'end'
:
if
has_key
(
n
):
self
.
batch
=
1
...
...
@@ -709,6 +717,8 @@ class InClass:
s
.
append
((
k
,
client
))
s
.
sort
()
if
self
.
reverse
:
s
.
reverse
()
sequence
=
[]
for
k
,
client
in
s
:
sequence
.
append
(
client
)
...
...
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