Skip to content. | Skip to navigation

Personal tools
Log in
Sections
You are here: Home Web Plone Snippets and Examples Checking if an Object is in the Portal Factory

Checking if an Object is in the Portal Factory

If you need to know if you're dealing with a temporary object, this is the right way to do it.

Taken from Martin Aspeli's contentrules package (handers.py):

def is_portal_factory(context):
"""Find out if the given object is in portal_factory
"""
portal_factory = getToolByName(context, 'portal_factory', None)
if portal_factory is not None:
return portal_factory.isTemporary(context)
else:
return False
Document Actions

Comments (0)

« May 2012 »
May
MoTuWeThFrSaSu
123456
78910111213
14151617181920
21222324252627
28293031