@core_helper
def get_facet_items_dict(facet, limit=None, exclude_active=False):
 if ((not c.search_facets) or (not c.search_facets.get(facet)) or (not c.search_facets.get(facet).get('items'))):
  return []
 facets = []
 for facet_item in c.search_facets.get(facet)['items']:
  if (not len(facet_item['name'].strip())):
   continue
  if (not ((facet, facet_item['name']) in request.params.items())):
   facets.append(dict(active=False, **facet_item))
  elif (not exclude_active):
   facets.append(dict(active=True, **facet_item))
 facets.sort(key=(lambda it: ((- it['count']), it['display_name'].lower())))
 if (c.search_facets_limits and (limit is None)):
  limit = c.search_facets_limits.get(facet)
 if ((limit is not None) and (limit > 0)):
  return facets[:limit]
 return facets

@ core_helper def get_facet_items_dict ( facet , limit = None , exclude_active = False ) : if ( ( not c . search_facets ) or ( not c . search_facets . get ( facet ) ) or ( not c . search_facets . get ( facet ) . get ( 'items' ) ) ) : return [ ] facets = [ ] for facet_item in c . search_facets . get ( facet ) [ 'items' ] : if ( not len ( facet_item [ 'name' ] . strip ( ) ) ) : continue if ( not ( ( facet , facet_item [ 'name' ] ) in request . params . items ( ) ) ) : facets . append ( dict ( active = False , ** facet_item ) ) elif ( not exclude_active ) : facets . append ( dict ( active = True , ** facet_item ) ) facets . sort ( key = ( lambda it : ( ( - it [ 'count' ] ) , it [ 'display_name' ] . lower ( ) ) ) ) if ( c . search_facets_limits and ( limit is None ) ) : limit = c . search_facets_limits . get ( facet ) if ( ( limit is not None ) and ( limit > 0 ) ) : return facets [ : limit ] return facets
return the list of unselected facet items for the given facet .