[Zope-Checkins] CVS: Zope2 - ZCatalog.py:1.85
Chris McDonough
chrism@digicool.com
Wed, 21 Mar 2001 17:49:12 -0500 (EST)
Update of /cvs-repository/Zope2/lib/python/Products/ZCatalog
In directory korak:/home/chrism/sandboxes/TrunkBranch/lib/python/Products/ZCatalog
Modified Files:
ZCatalog.py
Log Message:
Fixed problem of ZCatalog instantiation with no container and no vocab_id.
--- Updated File ZCatalog.py in package Zope2 --
--- ZCatalog.py 2001/03/21 21:47:04 1.84
+++ ZCatalog.py 2001/03/21 22:49:12 1.85
@@ -224,8 +224,11 @@
_v_transaction = None
def __init__(self, id, title='', vocab_id=None, container=None):
- self=self.__of__(container)
-
+ if vocab_id is not None and container is None:
+ raise CatalogError, ("You cannot specify a vocab_id without "
+ "also specifying a container.")
+ if container is not None:
+ self=self.__of__(container)
self.id=id
self.title=title