[CMF-checkins] CVS: Products/CMFDefault/skins/zpt_generic -
getBatchNavigation.py:1.3
Yvo Schubbe
y.2004_ at wcm-solutions.de
Tue Jul 6 11:40:52 EDT 2004
Update of /cvs-repository/Products/CMFDefault/skins/zpt_generic
In directory cvs.zope.org:/tmp/cvs-serv28044/CMFDefault/skins/zpt_generic
Modified Files:
getBatchNavigation.py
Log Message:
- use similar code for similar tasks in setRedirect.py and getBatchNavigation.py
- getBatchNavigation.py now also filters out all empty (false) variables
=== Products/CMFDefault/skins/zpt_generic/getBatchNavigation.py 1.2 => 1.3 ===
--- Products/CMFDefault/skins/zpt_generic/getBatchNavigation.py:1.2 Thu Apr 15 09:42:59 2004
+++ Products/CMFDefault/skins/zpt_generic/getBatchNavigation.py Tue Jul 6 11:40:52 2004
@@ -1,15 +1,6 @@
-## Script (Python) "getBatchNavigation"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
##parameters=batch_obj, target, type_singular='item', type_plural='items', previous_text='Previous', next_text='Next', **kw
-##title=
##
from ZTUtils import make_query
-if kw.has_key('b_start'):
- del kw['b_start']
if kw.has_key('portal_status_message'):
del kw['portal_status_message']
@@ -19,9 +10,11 @@
for batch in (batch_obj.previous, batch_obj.next):
length = batch and batch.length or 0
if length:
- batch_start = batch.first
- if batch_start:
- kw['b_start'] = batch_start
+ kw['b_start'] = batch.first
+ for k, v in kw.items():
+ if not v:
+ del kw[k]
+
query = kw and ( '?%s' % make_query(kw) ) or ''
url = '%s%s' % (target, query)
items.append( {'length': length > 1 and length or '',
More information about the CMF-checkins
mailing list