@treeio_login_required
def ajax_object_lookup(request, response_format='html'):
 objects = []
 if (request.GET and ('term' in request.GET)):
  objects = Object.filter_permitted(request.user.profile, Object.objects.filter(object_name__icontains=request.GET['term']), mode='x')[:10]
 return render_to_response('core/ajax_object_lookup', {'objects': objects}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required def ajax_object_lookup ( request , response_format = 'html' ) : objects = [ ] if ( request . GET and ( 'term' in request . GET ) ) : objects = Object . filter_permitted ( request . user . profile , Object . objects . filter ( object_name__icontains = request . GET [ 'term' ] ) , mode = 'x' ) [ : 10 ] return render_to_response ( 'core/ajax_object_lookup' , { 'objects' : objects } , context_instance = RequestContext ( request ) , response_format = response_format )
returns a list of matching objects .