<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:o = 
"urn:schemas-microsoft-com:office:office" xmlns:w = 
"urn:schemas-microsoft-com:office:word"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR>
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
PRE {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Courier New"
}
SPAN.EmailStyle17 {
        FONT-WEIGHT: normal; COLOR: windowtext; FONT-STYLE: normal; FONT-FAMILY: Arial; TEXT-DECORATION: none; mso-style-type: personal-compose
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=533115522-10042006>Hello:</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=533115522-10042006>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.</SPAN></FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=533115522-10042006></SPAN></FONT></FONT></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face=Arial><FONT color=#0000ff><FONT size=2><SPAN 
class=533115522-10042006></SPAN>ptypes = 
context.portal_types.objectValues()</FONT></FONT></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=533115522-10042006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=533115522-10042006><FONT face=Arial 
color=#0000ff size=2>sample script to test is:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=533115522-10042006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=533115522-10042006><FONT face=Arial 
color=#0000ff size=2>-------------------------------</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=533115522-10042006><SPAN 
class=533115522-10042006></SPAN><FONT face=Arial color=#0000ff size=2>ptypes = 
context.portal_types.objectValues()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=533115522-10042006><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=533115522-10042006><FONT face=Arial 
color=#0000ff size=2>for ptype in ptypes:<BR>&nbsp;print ptype<BR>return 
printed</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=533115522-10042006><FONT face=Arial 
color=#0000ff size=2>------------------------------</FONT></SPAN></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff 
size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=en-us><FONT face="Courier New" size=2>With Regards,</FONT></SPAN> 
<BR><SPAN lang=en-us><FONT face="Courier New" size=2>Aruna 
Kathiriya</FONT></SPAN> <BR><SPAN lang=en-us><FONT face="Courier New" 
size=2>Sr.Consultant,</FONT></SPAN> <BR><SPAN lang=en-us><FONT 
face="Courier New" size=2>CIGNEX Technologies, Inc</FONT></SPAN> <BR><SPAN 
lang=en-us><FONT face="Courier New" size=2>T:&nbsp;&nbsp;&nbsp; 408.327.9900 x 
306</FONT></SPAN> <BR><SPAN lang=en-us><FONT face="Courier New" 
size=2>F:&nbsp;&nbsp;&nbsp; 408.273.6785</FONT></SPAN> <BR><SPAN 
lang=en-us><FONT face="Courier New" size=2>E:&nbsp;&nbsp;&nbsp; 
aruna@cignex.com</FONT></SPAN> <BR><SPAN lang=en-us><FONT face="Courier New" 
size=2>U:&nbsp;&nbsp;&nbsp; www.cignex.com</FONT></SPAN> <BR><SPAN 
lang=en-us><FONT face="Courier New" size=2>"Implement IT Right"</FONT></SPAN> 
</P>
<DIV>&nbsp;</DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> zope-dev-bounces@zope.org 
[mailto:zope-dev-bounces@zope.org] <B>On Behalf Of </B>Takahashi, 
Michael<BR><B>Sent:</B> Monday, April 10, 2006 3:47 PM<BR><B>To:</B> 
zope-dev@zope.org<BR><B>Subject:</B> [Zope-dev] Is there a function to get the 
object type?<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi 
guys,<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I&#8217;m trying to write a function that checks to see if the current object is a &#8216;Folder&#8217;.&nbsp; &nbsp;<o:p></o:p></SPAN></FONT></PRE>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I am using this tutorial as a 
reference: <o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><A 
href="http://plone.org/documentation/how-to/pre-populated-folder">http://plone.org/documentation/how-to/pre-populated-folder</A><o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">To create a new content object, the 
following command is used:<o:p></o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">parent.invokeFactory(id=id, type_name='Folder')<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Is there a function that can check what type this newly created object is? Obviously its &#8216;Folder&#8217; in this example, but I&#8217;d like to be able to get the type_name of an object returned anywhere in my site to see if it is a &#8216;Folder&#8217;. <o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks,<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Mike<o:p></o:p></SPAN></FONT></PRE><PRE><FONT face=Arial size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></PRE>
<P class=MsoNormal><FONT face=Arial size=3><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=3><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=3><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=3><SPAN 
style="FONT-SIZE: 12pt; FONT-FAMILY: Arial"><o:p>&nbsp;</o:p></SPAN></FONT></P></DIV></BODY></HTML>