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

Andreas Jung andreas at andreas-jung.com
Tue Jan 6 07:57:49 EST 2004


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

Modified Files:
      Tag: Zope-2_7-branch
	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.10.68.1 => 1.10.68.2 ===
--- Zope/lib/python/Products/PluginIndexes/common/util.py:1.10.68.1	Mon Sep 29 08:02:02 2003
+++ Zope/lib/python/Products/PluginIndexes/common/util.py	Tue Jan  6 07:57:13 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