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? I have the feeling that it shouldn't be too difficult, but I just can't seem to wrap my head around it! Many thanks, Rita. __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/
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
Fearless Froggie wrote at 2003-3-3 16:23 -0800:
If I have an address such as the following:
an_address = context.REQUEST['URL2']
How would I get the metatype of the object
You get the object with "getattr" and then its "meta_type" attribute. "getattr" is an FAQ. Dieter
participants (3)
-
Dieter Maurer -
Dylan Reinhardt -
Fearless Froggie