summaryrefslogtreecommitdiff
path: root/app/locations
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2014-05-27 20:29:43 -0400
committerluxagraf <sng@luxagraf.net>2014-05-27 20:29:43 -0400
commitf840e5310215ffb894ea8a648ea03d463d029fbc (patch)
treeef0e4627c41b54b790688ad24d4f1bbac9ba480a /app/locations
parent70b6c4e84a0b8cc7554ebbd65d237e8f241c31fd (diff)
fixed render_to_geojson
Diffstat (limited to 'app/locations')
-rw-r--r--app/locations/views.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/locations/views.py b/app/locations/views.py
index e083e4f..bd5eb93 100644
--- a/app/locations/views.py
+++ b/app/locations/views.py
@@ -2,6 +2,7 @@ from django.shortcuts import render_to_response
from django.template import RequestContext
from blog.models import Entry
from locations.models import Country, Region, Route
+from projects.shortcuts import render_to_geojson
def map_list(request):
@@ -30,3 +31,14 @@ def map_data(request):
context,
context_instance=RequestContext(request)
)
+
+
+def data_json(request, id):
+ qs = Route.objects.filter(pk=id)
+ return render_to_geojson(
+ qs,
+ included_fields=['id', ],
+ geom_attribute='geometry',
+ mimetype='application/json',
+ pretty_print=True
+ )