Aplikacja z motywami
[redakcja.git] / apps / bookthemes / views.py
diff --git a/apps/bookthemes/views.py b/apps/bookthemes/views.py
new file mode 100755 (executable)
index 0000000..2bf5a77
--- /dev/null
@@ -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