[Zope-Checkins] CVS: Zope/lib/python/Products/ZCatalog -
Catalog.py:1.119
Sidnei da Silva
sidnei at awkly.org
Mon Apr 26 11:44:17 EDT 2004
Update of /cvs-repository/Zope/lib/python/Products/ZCatalog
In directory cvs.zope.org:/tmp/cvs-serv13977/lib/python/Products/ZCatalog
Modified Files:
Catalog.py
Log Message:
- Display index name on error message when index can't be used as
'sort_on'.
- PUT would fail if the created object had a __len__ = 0 (eg:
BTreeFolder2) and fallback to _default_put_factory. Fix by
checking if the returned object is None instead.
=== Zope/lib/python/Products/ZCatalog/Catalog.py 1.118 => 1.119 ===
--- Zope/lib/python/Products/ZCatalog/Catalog.py:1.118 Tue Apr 20 10:16:18 2004
+++ Zope/lib/python/Products/ZCatalog/Catalog.py Mon Apr 26 11:43:46 2004
@@ -735,12 +735,12 @@
# self.indexes is always a dict, so get() w/ 1 arg works
sort_index = self.indexes.get(sort_index_name)
if sort_index is None:
- raise CatalogError, 'Unknown sort_on index'
+ raise CatalogError, 'Unknown sort_on index (%s)' % sort_index_name
else:
if not hasattr(sort_index, 'keyForDocument'):
raise CatalogError(
- 'The index chosen for sort_on is not capable of being'
- ' used as a sort index.'
+ 'The index chosen for sort_on (%s) is not capable of being'
+ ' used as a sort index.' % sort_index_name
)
return sort_index
else:
More information about the Zope-Checkins
mailing list