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
0570634e
Commit
0570634e
authored
Aug 27, 1999
by
Christopher Petrilli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed reverse so that it doesn't modify the database in place.
parent
2e1f1428
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
lib/python/DocumentTemplate/DT_In.py
lib/python/DocumentTemplate/DT_In.py
+13
-5
No files found.
lib/python/DocumentTemplate/DT_In.py
View file @
0570634e
...
...
@@ -124,7 +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).
reverse -- Reverse the sequence (may be combined with sort). Note
that this can cause a huge memory use in lazy activation instances.
Within an 'in' block, variables are substituted from the
elements of the iteration. The elements may be either
...
...
@@ -381,8 +382,8 @@
'''
#'
__rcs_id__
=
'$Id: DT_In.py,v 1.3
7 1999/06/21 21:29:42 jim
Exp $'
__version__
=
'$Revision: 1.3
7
$'
[
11
:
-
2
]
__rcs_id__
=
'$Id: DT_In.py,v 1.3
8 1999/08/27 14:56:27 petrilli
Exp $'
__version__
=
'$Revision: 1.3
8
$'
[
11
:
-
2
]
from
DT_Util
import
ParseError
,
parse_params
,
name_param
,
str
from
DT_Util
import
render_blocks
,
InstanceDict
,
ValidationError
...
...
@@ -492,7 +493,7 @@ class InClass:
sequence
=
self
.
sort_sequence
(
sequence
)
if
self
.
reverse
is
not
None
:
sequence
.
reverse
(
)
sequence
=
self
.
reverse_sequence
(
sequence
)
next
=
previous
=
0
try
:
start
=
int_param
(
params
,
md
,
'start'
,
0
)
...
...
@@ -622,6 +623,7 @@ class InClass:
return
result
def
renderwob
(
self
,
md
):
"""RENDER WithOutBatch"""
expr
=
self
.
expr
name
=
self
.
__name__
if
expr
is
None
:
...
...
@@ -646,7 +648,7 @@ class InClass:
sequence
=
self
.
sort_sequence
(
sequence
)
if
self
.
reverse
is
not
None
:
sequence
.
reverse
(
)
sequence
=
self
.
reverse_sequence
(
sequence
)
vars
=
sequence_variables
(
sequence
)
kw
=
vars
.
data
...
...
@@ -730,6 +732,12 @@ class InClass:
return
sequence
def
reverse_sequence
(
self
,
sequence
):
s
=
list
(
sequence
)
s
.
reverse
()
return
s
basic_type
=
{
type
(
''
):
1
,
type
(
0
):
1
,
type
(
0.0
):
1
,
type
(()):
1
,
type
([]):
1
}.
has_key
...
...
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