def getCatalog(instance, field='UID'):
    """
    Returns the catalog that stores objects of instance passed in type.
    If an object is indexed by more than one catalog, the first match
    will be returned.

    :param instance: A single object
    :type instance: ATContentType
    :returns: The first catalog that stores the type of object passed in
    """
    uid = instance.UID()
    if 'workflow_skiplist' in instance.REQUEST and \
        [x for x in instance.REQUEST['workflow_skiplist']
         if x.find(uid) > -1]:
        return None
    else:
        # grab the first catalog we are indexed in.
        # we're only indexed in one.
        at = getToolByName(instance, 'archetype_tool')
        plone = instance.portal_url.getPortalObject()
        catalog_name = instance.portal_type in at.catalog_map \
            and at.catalog_map[instance.portal_type][0] or 'portal_catalog'
        catalog = getToolByName(plone, catalog_name)
        return catalog
def getCatalog ( instance , field = 'UID' ) : uid = instance . UID ( ) if 'workflow_skiplist' in instance . REQUEST and [ x for x in instance . REQUEST [ 'workflow_skiplist' ] if x . find ( uid ) > - 1 ] : return None else : at = getToolByName ( instance , 'archetype_tool' ) plone = instance . portal_url . getPortalObject ( ) catalog_name = instance . portal_type in at . catalog_map and at . catalog_map [ instance . portal_type ] [ 0 ] or 'portal_catalog' catalog = getToolByName ( plone , catalog_name ) return catalog
Returns the catalog that stores objects of instance passed in type.
    If an object is indexed by more than one catalog, the first match
    will be returned.

    :param instance: A single object
    :type instance: ATContentType
    :returns: The first catalog that stores the type of object passed in