You should use meta_type for checking what kind of object you have. Content-type is used by files and images for storing what kind of file or image the object holds. There is a Python tutorial at www.python.org Also, many excellent books, f ex from O'Reilly Press: http://www.oreilly.com/ For meta_types and Zope stuff you have the Zope book here: http://www.zope.org/Members/michel/ZB There is also a lot of Python code on the net that you can read in order to learn Python. Best regards and good luck Petter Enholm ----- Original Message ----- From: "Tom Nixon" <tom.nixon@aim23.com> To: <zope@zope.org> Sent: Monday, March 18, 2002 5:03 PM Subject: [Zope] Python question
I need a python script that will return the first folder in the hierarchy above the current object. I have got this far, but it looks like content_type isn't the property I need. Can anyone help me out? Also, is there somewhere I can find a reference for this sort of thing so I don't have to keep posting to the list?
p = context.aq_parent while p.content_type != "Folder": p = p.aq_parent return p
_______________________________________________ Zope maillist - Zope@zope.org 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 )