def get_referent_by_identifier(category, value):
 try:
  identifier = Identifier.find_one((Q('category', 'eq', category) & Q('value', 'eq', value)))
 except NoResultsFound:
  raise HTTPError(http.NOT_FOUND)
 if identifier.referent.url:
  return redirect(identifier.referent.url)
 raise HTTPError(http.NOT_FOUND)

def get_referent_by_identifier ( category , value ) : try : identifier = Identifier . find_one ( ( Q ( 'category' , 'eq' , category ) & Q ( 'value' , 'eq' , value ) ) ) except NoResultsFound : raise HTTPError ( http . NOT_FOUND ) if identifier . referent . url : return redirect ( identifier . referent . url ) raise HTTPError ( http . NOT_FOUND )
look up identifier by category and value and redirect to its referent if found .