Commits

George Notaras committed a86a657

Improved URL and view naming scheme.

Comments (0)

Files changed (2)

src/taggit_autocomplete_modified/urls.py

 from django.conf.urls.defaults import *
 
 urlpatterns = patterns('taggit_autocomplete_modified.views',
-    url(r'^json$', 'list_tags', name='taggit_autocomplete-list'),
+    url(r'^json$', 'tag_list_view', name='taggit_autocomplete_modified_tag_list'),
 )
 

src/taggit_autocomplete_modified/views.py

 from django.db.models.loading import cache
 from django.http import HttpResponse
 from django.utils.datastructures import MultiValueDictKeyError
+from django.utils import simplejson
 
 from taggit_autocomplete_modified import settings
 
 
-def list_tags(request):
+def tag_list_view(request):
     app_label, model_class = settings.TAGGIT_AUTOCOMPLETE_TAG_MODEL.split('.')
     Tag = cache.get_model(app_label, model_class)
     try:
     except MultiValueDictKeyError:
         tags = []
     return HttpResponse('\n'.join(tags), mimetype='text/plain')
+    #return HttpResponse(simplejson.dumps(tags), mimetype='text/plain')
+    #return HttpResponse(simplejson.dumps(tags), mimetype='application/json')
+    #return HttpResponse('\n'.join(tags), mimetype='text/plain')