[Zope-CMF] How to get the inherited's meta_type in DTML ?

Pascal Samuzeau samuzeau@oreka.com
Mon, 09 Dec 2002 17:59:53 +0100


Hi,                                                                   
                                                                      
I have an URL as :                                                    
                                                                      
http://mysite/myobject/mydtmldocument                                 
                                                                      
In mydtmldocument I need to know what is the meta_type of myobject.   
                                                                      
So I did :                                                            
...                                                                   
<dtml-if "_.getattr(this(), 'meta_type') == 'TypeX'">                 
<dtml-call expr="REQUEST.set('typehere',this().getId())">             
...                                                                   
                                                                      
But my problem, is that I am able to call "mydtmldocument" anywhere,  
by acquisition as sample :                                            
                                                                      
http://mysite/myobject/myfolders/myfolder/thisfolder/mydtmldocument.  
                                                                      
If I do with aq_parent, i need to test all opportunities !!!          
                                                                      
How to write such a DTML search for my meta_type's instance ?         
                                                                      
Do I need to write a python's script ?                                
                                                                      
Cheers                                                                
PS                                                                    
--------------------------------------------------                    
Oreka ! Nous sommes l'internet moins cher !                           
Surfez 25% moins cher avec http://www.oreka.com