[Zope-CMF] 'Products.ZCatalog.ZCatalog' module has no attribute '__bases__'

Tres Seaver tseaver@zope.com
21 Nov 2002 10:56:04 -0500


On Thu, 2002-11-21 at 04:18, Pascal Samuzeau wrote:
> Hi,                                                                   
>                                                                       
> I've got this error when I try to add an object. I cna't understand,  
> because on my product's definition I have just :                      
>                                                                       
> from Products.ZCatalog import ZCatalog

'Products.ZCatalog' is a Python package.
'Products.ZCatalog.ZCatalog' is a Python module.
'Products.ZCatalog.ZCatalog.ZCatalog' is a Python class.

Your import gives you the module, not the class.
                                
>                                                                       
> and I use it somewhere as :                                           
>                                                                       
> test.manage_addProduct['ZCatalog'].manage_addZCatalog('Catalog','Catal
> og')                                                                  
> test.Catalog.manage_addIndex('test1','FieldIndex')                    
> test.Catalog.manage_addIndex('test2','TextIndex')                     
> test.Catalog.manage_addIndex('test3','TextIndex')                     
> test.Catalog.manage_addIndex('test4','TextIndex')                     
>                                                                       
> **********************************************************            
> Error Type: AttributeError                                            
> Error Value: 'Products.ZCatalog.ZCatalog' module has no attribute     
> '__bases__'                                                           
>                                                                       
>                                                                       
> File Zope\lib\python\AccessControl\Role.py, line 554, in              
> gather_permissions                                                    
> (Object: Products.ZCatalog.ZCatalog)                                  
> AttributeError: (see above)                                           
> **********************************************************            
>                                                                       
> I don't understand what is happening.                                 
> Anybody knows ?                               

Without seeing the whole thing, I can't say for sure, but the
AttributeError indicates that the module / class confusion is at the
root.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com