@treeio_login_required
def ajax_access_lookup(request, response_format='html'):
 entities = []
 if (request.GET and ('term' in request.GET)):
  entities = AccessEntity.objects.filter(((Q(user__name__icontains=request.GET['term']) | Q(user__contact__name__icontains=request.GET['term'])) | Q(group__name__icontains=request.GET['term'])))
 return render_to_response('identities/ajax_access_lookup', {'entities': entities}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required def ajax_access_lookup ( request , response_format = 'html' ) : entities = [ ] if ( request . GET and ( 'term' in request . GET ) ) : entities = AccessEntity . objects . filter ( ( ( Q ( user__name__icontains = request . GET [ 'term' ] ) | Q ( user__contact__name__icontains = request . GET [ 'term' ] ) ) | Q ( group__name__icontains = request . GET [ 'term' ] ) ) ) return render_to_response ( 'identities/ajax_access_lookup' , { 'entities' : entities } , context_instance = RequestContext ( request ) , response_format = response_format )
returns a list of matching users .