From 1e06d655adee6c570228c7f092d92eadb52624ba Mon Sep 17 00:00:00 2001 From: Sanj Date: Fri, 6 Jul 2012 22:02:40 +0530 Subject: [PATCH] stuff --- itf/itfprofiles/views.py | 2 +- itf/templates/test/person_form.html | 9 ++++++--- requirements.txt | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/itf/itfprofiles/views.py b/itf/itfprofiles/views.py index d3110af..b7b8f1b 100644 --- a/itf/itfprofiles/views.py +++ b/itf/itfprofiles/views.py @@ -22,7 +22,7 @@ def autocomplete(request): qset = Person.objects.filter(first_name__icontains=q) paginator = Paginator(qset, page_limit) results = paginator.page(page) - items = [{'id': obj.id, 'first_name': obj.first_name, 'last_name': obj.last_name, 'text': obj.first_name} for obj in results.object_list] + items = [{'id': obj.id, 'first_name': obj.first_name, 'last_name': obj.last_name, 'about': obj.about, 'text': obj.first_name + " " + obj.last_name} for obj in results.object_list] return render_to_json_response({ 'items': items, 'has_next': results.has_next() diff --git a/itf/templates/test/person_form.html b/itf/templates/test/person_form.html index ff58b71..b0111f3 100644 --- a/itf/templates/test/person_form.html +++ b/itf/templates/test/person_form.html @@ -62,11 +62,13 @@ $(function(){ return {results: data.items, more: more}; } }, - formatResults: function(item) { + formatResult: function(item) { //console.log(item); - return "
" + item.first_name + " " + item.last_name + "
"; + return "
" + item.first_name + " " + item.last_name + "
" + item.about + "
"; }, formatSelection: function(item) { + //console.log(item); + //return "
" + item.first_name + " " + item.last_name + "
" + item.about + "
"; //console.log("foo"); return item.first_name + " " + item.last_name; //return "
" + item.first_name + " " + item.last_name + "
"; @@ -79,7 +81,8 @@ $(function(){ 'id': "x_" + parseInt(Math.random() * 1000), 'text': term, 'first_name': first_name, - 'last_name': last_name + 'last_name': last_name, + 'about': '...' } } }); diff --git a/requirements.txt b/requirements.txt index ef21a14..81f164e 100755 --- a/requirements.txt +++ b/requirements.txt @@ -18,3 +18,5 @@ django-haystack Markdown django-crispy-forms django-floppyforms +django-markitup +twitter