[Zope-Checkins] CVS: Zope2 - dtml-sequence.stx:1.4
Amos Latteier
amos@digicool.com
Fri, 25 May 2001 16:43:09 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/Products/OFSP/help
In directory korak.digicool.com:/tmp/cvs-serv22846
Modified Files:
dtml-sequence.stx
Log Message:
Added examples to the _.sequence.sort docs.
--- Updated File dtml-sequence.stx in package Zope2 --
--- dtml-sequence.stx 2001/05/25 17:19:38 1.3
+++ dtml-sequence.stx 2001/05/25 20:43:08 1.4
@@ -29,7 +29,24 @@
Examples
- XXX
+ Sort child object (using the 'objectValues' method) by id (using
+ the 'getId' method), ignoring case::
+
+ <dtml-in expr="_.sequence.sort(objectValues(),
+ (('getId', 'nocase'),))">
+ <dtml-var getId> <br>
+ </dtml-in>
+
+ Sort child objects by title (ignoring case) and date (from newest
+ to oldest)::
+
+ <dtml-in expr="_.sequence.sort(objectValues(),
+ (('title', 'nocase'),
+ ('bobobase_modification_time',
+ 'cmp', desc')
+ ))">
+ <dtml-var title> <dtml-var bobobase_modification_time> <br>
+ </dtml-in>
See Also