equal
deleted
inserted
replaced
5 from django.contrib.auth.decorators import login_required |
5 from django.contrib.auth.decorators import login_required |
6 from django.contrib.auth.models import User |
6 from django.contrib.auth.models import User |
7 from django.core.context_processors import csrf |
7 from django.core.context_processors import csrf |
8 from django.core.urlresolvers import reverse |
8 from django.core.urlresolvers import reverse |
9 from django.utils import simplejson as json |
9 from django.utils import simplejson as json |
|
10 |
|
11 from tagging.models import Tag |
10 |
12 |
11 from pytask.views import show_msg |
13 from pytask.views import show_msg |
12 |
14 |
13 from pytask.taskapp import forms as taskapp_forms |
15 from pytask.taskapp import forms as taskapp_forms |
14 from pytask.taskapp import models as taskapp_models |
16 from pytask.taskapp import models as taskapp_models |
685 tag_entities = Tag.objects.filter(name__icontains=term) |
687 tag_entities = Tag.objects.filter(name__icontains=term) |
686 response = [tag.name for tag in tag_entities] |
688 response = [tag.name for tag in tag_entities] |
687 |
689 |
688 json_response = json.dumps(response) |
690 json_response = json.dumps(response) |
689 return http.HttpResponse(json_response) |
691 return http.HttpResponse(json_response) |
690 |
|
691 def suggest_task_tags(request): |
|
692 """Returns the tags matching the query for the AJAXy autocomplete |
|
693 to get tags related to tasks. |
|
694 """ |
|
695 |
|
696 taskapp_models.Task.objects.filter(tags) |
|
697 json_response = json.dumps(['abc', 'bca', 'bowbow']) |
|
698 return http.HttpResponse(json_response) |
|