X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/1eb51aa3f7a7add93f837456759d453288e6a454..7f5e25a1b44bd8ad23ecb5d8194306b319998a72:/forum/views/commands.py diff --git a/forum/views/commands.py b/forum/views/commands.py index ee62af4..5a76d06 100644 --- a/forum/views/commands.py +++ b/forum/views/commands.py @@ -346,6 +346,17 @@ def mark_tag(request, tag=None, **kwargs):#tagging system ts.update(reason=reason) return HttpResponse(simplejson.dumps(''), mimetype="application/json") +def matching_tags(request): + if len(request.GET['q']) == 0: + raise Exception(_("Invalid request")) + + possible_tags = Tag.objects.filter(name__istartswith = request.GET['q']) + tag_output = '' + for tag in possible_tags: + tag_output += (tag.name + "|" + tag.name + "." + tag.used_count.__str__() + "\n") + + return HttpResponse(tag_output, mimetype="text/plain") + @ajax_login_required def ajax_toggle_ignored_questions(request):#ajax tagging and tag-filtering system if request.user.hide_ignored_questions: