[Zope] - Getting

Scott Robertson sroberts@codeit.com
Fri, 11 Dec 1998 09:27:29 -0800 (PST)


I want to add an index_html to my folderiod object, but I only want to do
that if the parent object is not the same as the object that I am adding.
I thought I could use the isinstance() function but I get this message. 



Sorry, an error occurred.<p>
<!--
Traceback (innermost last):
  File /home/sroberts/src/Zope-1.9b1-src/lib/python/ZPublisher/Publish.py,
line 861, in publish_module
  File /home/sroberts/src/Zope-1.9b1-src/lib/python/ZPublisher/Publish.py,
line 583, in publish
    (Info: /manage_addZlilBlackBook)
  File
/home/sroberts/src/Zope-1.9b1-src/lib/python/Products/ZlilBlackBook/ZlilBlackBook.py,
line 22, in addZlilBlackBook
    (Object: ApplicationDefaultPermissions)
TypeError: second argument must be a class


--This is the function where the error occurs-------------

def addZlilBlackBook(self, id, title='', 
		     organization='', phone='', REQUEST=None):
    """Method to add a Address book to Zope"""
    NewBook = ZlilBlackBook(id, title, organization, phone)
    if isinstance(self, ZlilBlackBook):
	NewBook.test = "Parent is a BlackBook"
    else:
	NewBook.test = "Parent is not a BlackBook"
    # Self is the folder that will contain our new object
    self._setObject(id, NewBook )
    # return to the parent object's manage_main
    if REQUEST is not None: return self.manage_main(self,REQUEST)


----------------------------------------
This class is defined in the same file as this function.
Is there some weird scoping issue that I am not aware of?
---------------------------------------------------
- Scott Robertson             Phone: 714.972.2299 -
- CodeIt Computing            Fax:   714.972.2399 -
-                http://codeit.com                -
---------------------------------------------------