[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/common - util.py:1.12

Andreas Jung andreas at andreas-jung.com
Wed Jan 7 11:44:35 EST 2004


Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/common
In directory cvs.zope.org:/tmp/cvs-serv23621/common

Modified Files:
	util.py 
Log Message:

     - Using "_usage" parameters in a ZCatalog query is deprecated and
       logged as DeprecationWarning.


=== Zope/lib/python/Products/PluginIndexes/common/util.py 1.11 => 1.12 ===
--- Zope/lib/python/Products/PluginIndexes/common/util.py:1.11	Mon Sep 29 08:00:17 2003
+++ Zope/lib/python/Products/PluginIndexes/common/util.py	Wed Jan  7 11:44:30 2004
@@ -15,6 +15,7 @@
 
 
 import re
+from warnings import warn
 from types import StringType,ListType,TupleType,DictType,InstanceType
 from DateTime import DateTime
 
@@ -65,7 +66,6 @@
         """
 
         self.id = iid
-
         if not request.has_key(iid):
             self.keys = None
             return
@@ -74,6 +74,7 @@
         usage_param = iid + '_usage'
         if request.has_key(usage_param):
             self.usage = request[usage_param]
+            warn("\nZCatalog query using '%s' detected.\nUsing query parameters ending with '_usage' is deprecated.\nConsider using record-style parameters instead (see lib/python/Products/PluggableIndexes/README.txt for details)" % usage_param, DeprecationWarning)
 
         param = request[iid]
         keys = None




More information about the Zope-Checkins mailing list