@view
def people(request):
 data = {}
 query = request.GET.get('q', '')
 data['raw_query'] = query
 parsed_query = mysite.profile.view_helpers.parse_string_query(query)
 data.update(parsed_query)
 if parsed_query['q'].strip():
  search_results = parsed_query['callable_searcher']()
  (everybody, extra_data) = (search_results.people, search_results.template_data)
  data.update(extra_data)
  data['people'] = everybody
  person_id_ranges = mysite.base.view_helpers.int_list2ranges([x.id for x in data['people']])
  person_ids = ''
  for (stop, start) in person_id_ranges:
   if (stop == start):
    person_ids += ('%d,' % (stop,))
   else:
    person_ids += ('%d-%d,' % (stop, start))
 else:
  data = {}
 return (request, 'profile/search_people.html', data)

@ view def people ( request ) : data = { } query = request . GET . get ( 'q' , '' ) data [ 'raw_query' ] = query parsed_query = mysite . profile . view_helpers . parse_string_query ( query ) data . update ( parsed_query ) if parsed_query [ 'q' ] . strip ( ) : search_results = parsed_query [ 'callable_searcher' ] ( ) ( everybody , extra_data ) = ( search_results . people , search_results . template_data ) data . update ( extra_data ) data [ 'people' ] = everybody person_id_ranges = mysite . base . view_helpers . int_list2ranges ( [ x . id for x in data [ 'people' ] ] ) person_ids = '' for ( stop , start ) in person_id_ranges : if ( stop == start ) : person_ids += ( '%d,' % ( stop , ) ) else : person_ids += ( '%d-%d,' % ( stop , start ) ) else : data = { } return ( request , 'profile/search_people.html' , data )
display a list of people .