@treeio_login_required
def ajax_user_lookup(request, response_format='html'):
 users = []
 if (request.GET and ('term' in request.GET)):
  users = User.objects.filter((Q(name__icontains=request.GET['term']) | Q(contact__name__icontains=request.GET['term'])))
 return render_to_response('identities/ajax_user_lookup', {'users': users}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required def ajax_user_lookup ( request , response_format = 'html' ) : users = [ ] if ( request . GET and ( 'term' in request . GET ) ) : users = User . objects . filter ( ( Q ( name__icontains = request . GET [ 'term' ] ) | Q ( contact__name__icontains = request . GET [ 'term' ] ) ) ) return render_to_response ( 'identities/ajax_user_lookup' , { 'users' : users } , context_instance = RequestContext ( request ) , response_format = response_format )
returns a list of matching users .