summaryrefslogtreecommitdiff
path: root/app/locations/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/locations/views.py')
-rw-r--r--app/locations/views.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/locations/views.py b/app/locations/views.py
new file mode 100644
index 0000000..f360429
--- /dev/null
+++ b/app/locations/views.py
@@ -0,0 +1,25 @@
+from django.shortcuts import render_to_response,get_object_or_404
+from django.template import RequestContext
+
+from blog.models import Entry
+from locations.models import Location, Country, Region, Route
+
+def list_view(request):
+ context = {
+ 'object_list' : Entry.objects.filter(status__exact=1),
+ 'country_list' : Country.objects.filter(visited=True).exclude(name='default'),
+ 'region_list' : Region.objects.all()
+ }
+ return render_to_response('archives/map.html', context, context_instance=RequestContext(request))
+
+from projects.shortcuts import render_to_geojson
+
+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
+ ) \ No newline at end of file