@treeio_login_required
def ajax_tag_lookup(request, response_format='html'):
 tags = []
 if (request.GET and ('term' in request.GET)):
  tags = Tag.objects.filter(name__icontains=request.GET['term'])
 return render_to_response('core/ajax_tag_lookup', {'tags': tags}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required def ajax_tag_lookup ( request , response_format = 'html' ) : tags = [ ] if ( request . GET and ( 'term' in request . GET ) ) : tags = Tag . objects . filter ( name__icontains = request . GET [ 'term' ] ) return render_to_response ( 'core/ajax_tag_lookup' , { 'tags' : tags } , context_instance = RequestContext ( request ) , response_format = response_format )
returns a list of matching tags .