@treeio_login_required
def ajax_task_lookup(request, response_format='html'):
 if (request.GET and ('term' in request.GET)):
  tasks = Task.objects.filter(name__icontains=request.GET['term'])[:10]
 else:
  tasks = []
 return render_to_response('projects/ajax_task_lookup', {'tasks': tasks}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required def ajax_task_lookup ( request , response_format = 'html' ) : if ( request . GET and ( 'term' in request . GET ) ) : tasks = Task . objects . filter ( name__icontains = request . GET [ 'term' ] ) [ : 10 ] else : tasks = [ ] return render_to_response ( 'projects/ajax_task_lookup' , { 'tasks' : tasks } , context_instance = RequestContext ( request ) , response_format = response_format )
returns a list of matching tasks .