Hello:
You can get the types from following function. Once you
get the list of the types of the object type, you can use it as you
want.
ptypes =
context.portal_types.objectValues()
sample script to test is:
-------------------------------
ptypes =
context.portal_types.objectValues()
for ptype in ptypes:
print ptype return printed ------------------------------
With Regards,
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Takahashi, Michael Sent: Monday, April 10, 2006 3:47 PM To: zope-dev@zope.org Subject: [Zope-dev] Is there a function to get the object type? Hi
guys, I’m trying to write a function that checks to see if the current object is a ‘Folder’.
I am using this tutorial as a
reference: http://plone.org/documentation/how-to/pre-populated-folder To create a new content object, the
following command is used: parent.invokeFactory(id=id, type_name='Folder')
Is there a function that can check what type this newly created object is? Obviously its ‘Folder’ in this example, but I’d like to be able to get the type_name of an object returned anywhere in my site to see if it is a ‘Folder’.
Thanks,
Mike
|
_______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )