def search_by_prefix(portal_type, prefix):
    """Returns brains which share the same portal_type and ID prefix
    """
    catalog = api.get_tool("uid_catalog")
    brains = catalog({"portal_type": portal_type})
    # Filter brains with the same ID prefix
    return filter(lambda brain: api.get_id(brain).startswith(prefix), brains)
def search_by_prefix ( portal_type , prefix ) : catalog = api . get_tool ( "uid_catalog" ) brains = catalog ( { "portal_type" : portal_type } ) return filter ( lambda brain : api . get_id ( brain ) . startswith ( prefix ) , brains )
Returns brains which share the same portal_type and ID prefix