[Zope] Getting metatype information

Dylan Reinhardt zope@dylanreinhardt.com
Mon, 03 Mar 2003 16:45:29 -0800


At 04:23 PM 3/3/2003, Fearless Froggie wrote:
>Hi,
>
>If I have an address such as the following:
>
>an_address = context.REQUEST['URL2']
>
>How would I get the metatype of the object
>"an_address" is pointing to?

Assuming that the last object referenced in the URL represents the object 
in question, you can use the following in a Python Script:

my_obj_name = context.REQUEST['URL'][len(context.REQUEST['URL1'])+1:]
return context[my_obj_name].meta_type

HTH,

Dylan