All pastes #248811 Raw Edit

Something

public text v1 · immutable
#248811 ·published 2006-11-15 00:57 UTC
rendered paste body
def autocomplete(request):
	from django.utils import simplejson
	query = request.GET.get('query', None)
	dataset = []
	if query:
		dataset = [{'text': l.phrase} for l in LabelSum.objects.filter(phrase__startswith=query).order_by('phrase')[:10]]
	return simplejson.dumps(dataset)