[Zope-CMF] Disallowed subobject type

Pascal Samuzeau samuzeau@oreka.com
Fri, 11 Oct 2002 14:49:59 +0100


Luke was not waiting to what Obi-wan tolds him, he did it just before 
Obi wrote him.                                                        
                                                                      
But in those case, no effect appears.                                 
                                                                      
So I've commented those 3 lines :                                     
                                                                      
                                                                      
        #if myType is not None:                                       
        #    if not myType.allowType( type_name ):                    
        #        raise ValueError, 'Disallowed subobject type: %s     
                                                                      
Yes I know it's not a good job, but it's working now, until I find    
what's really happened.                                               
                                                                      
Just before, I've installed, with difficulty the CMF Forum. Is there  
any relationships ???                                                 
                                                                      
Kind for this help.                                                   
PS                                                                    
                                                                      
                                                                      
-------------------                                                   
> On Fri, 2002-10-11 at 08:42, Pascal Samuzeau wrote:                 
> > Hi,                                                               
                                                                      
> >                                                                   
                                                                      
> > I have this error :                                               
                                                                      
> >                                                                   
                                                                      
> > Type de l'erreur : ValueError                                     
                                                                      
> > Valeur de l'erreur : Disallowed subobject type: Document          
                                                                      
> >                                                                   
                                                                      
> > Does anybody know about it ?                                      
>                                                                     
> Obi-wan says, "Use the source, Luke!"                               
>                                                                     
>  [/opt/home/tseaver/projects/CMF]                                   
>  $ find . -name "*.py" | xargs grep Disallowed                      
>  ./CMFCore/PortalFolder.py:                raise ValueError,\       
>     'Disallowed  subobject type: %s' % type_name                    
>                                                                     
> which takes us to PortalFolder's 'invokeFactory' method:            
>                                                                     
>     def invokeFactory( self                                         
>                      , type_name                                    
>                      , id                                           
>                      , RESPONSE=None                                
>                      , *args                                        
>                      , **kw                                         
>                      ):                                             
>         '''                                                         
>         Invokes the portal_types tool.                              
>         '''                                                         
>         pt = getToolByName( self, 'portal_types' )                  
>         myType = pt.getTypeInfo(self)                               
>                                                                     
>         if myType is not None:                                      
>             if not myType.allowType( type_name ):                   
>                 raise ValueError, 'Disallowed subobject type: %s'\  
>                    % type_name                                      
>                                                                     
>         apply( pt.constructContent                                  
>              , (type_name, self, id, RESPONSE) + args               
>              , kw                                                   
>              )                                                      
>                                                                     
> TypeInformation objects are allowed to filter the content types     
which                                                                 
> are addable within them, via the 'allowType' method;  out-of-the-box
> FactoryTypeInformation handles this by checking the                 
> 'filter_content_types' and 'allowed_content_types' properties.      
>                                                                     
> Tres.                                                               
> --                                                                  
> ===============================================================     
> Tres Seaver                                tseaver@zope.com         
> Zope Corporation      "Zope Dealers"       http://www.zope.com      
>                                                                     
>                                                                     
Cordialement                                                          
PS                                                                    
--------------------------------------------------                    
Oreka ! Nous sommes l'internet moins cher !                           
Surfez 25% moins cher avec http://www.oreka.com