X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/b718b3f69d43ba7f32f4ad6a5c31429fa3dc2c4e..058643c116876ba689f46d0fbac52345f60bf440:/apps/bookthemes/views.py diff --git a/apps/bookthemes/views.py b/apps/bookthemes/views.py new file mode 100755 index 00000000..2bf5a771 --- /dev/null +++ b/apps/bookthemes/views.py @@ -0,0 +1,16 @@ +# Create your views here. + +import logging +log = logging.getLogger('platforma.bookthemes') + +from django.http import HttpResponse +from django.utils import simplejson as json +from bookthemes.models import Theme + +def index(request): + themes = Theme.objects.all().values_list('name', flat=True).order_by('name') + + return HttpResponse(json.dumps(list(themes)), mimetype="application/json") + + + \ No newline at end of file