@treeio_login_required
def ajax_ticket_lookup(request, response_format='html'):
 tickets = []
 if (request.GET and ('term' in request.GET)):
  tickets = Ticket.objects.filter(name__icontains=request.GET['term'])[:10]
 return render_to_response('services/ajax_ticket_lookup', {'tickets': tickets}, context_instance=RequestContext(request), response_format=response_format)

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