in an external method, would not this work?:

def getclass(self, ob):
    return type(ob)

Then use the getclass fn from DTML:

 <dtml-var "getclass(anobject)">



-----Original Message-----
From: NABETH Thierry [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 26, 2000 4:11 AM
To: '[EMAIL PROTECTED]'
Cc: 'ethan mindlace fremen'
Subject: RE: [Zope] geting the type of an object from within dtml ???
==> it works


Hello, 
>> <dtml-var "meta_type"> works. 
Yes, it display the correct meta type. Thanks. 
When I had done some tests, I forgot to set the meta_type field, 
and the system was displaying the meta type of the superclass instead. 
(which had confused me). 
Note: 
I am still not very confortable to use the "meta_type" field to get the
class name, 
and would rather have prefered to have the real class itself. (python
type function). 



Thank you again for your help. 
Thierry 
Thierry Nabeth 
Research Fellow 
INSEAD CALT (the Centre for Advanced Learning Technologies) 
http://www.insead.fr/CALT/ 


-----Original Message----- 
From: ethan mindlace fremen [mailto:[EMAIL PROTECTED]] 
Sent: Monday, June 26, 2000 3:43 AM 
To: Thierry Nabeth 
Cc: [EMAIL PROTECTED] 
Subject: Re: [Zope] geting the type of an object from within dtml ??? 


Thierry Nabeth wrote: 
> for instance: 
> <dtml-var meta_type> 
> does not return the correct type. 
<dtml-var "meta_type"> works.  You can also use things like 
<dtml-in "objectValues(['DTML Document'])"> 
hope that helps, 
-- 
ethan mindlace fremen 
Zopatista Community Liason 

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to