From c5a6d45415c7601f9a515d05a61ee795dc37536b Mon Sep 17 00:00:00 2001 From: "luxagraf@c63593aa-01b0-44d9-8516-4b9c7e931d7f" Date: Sun, 13 Jun 2010 01:18:25 +0000 Subject: updated maps.html to use google maps v3 and created custom route model using gmaps polyline tools to encode points --- apps/blog/signals.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'apps/blog') diff --git a/apps/blog/signals.py b/apps/blog/signals.py index 9809f6f..23e6d3f 100644 --- a/apps/blog/signals.py +++ b/apps/blog/signals.py @@ -3,7 +3,7 @@ from django.conf import settings from django.template import Context from django.db.models import get_model -from locations.models import Region,Country +from locations.models import Region,Country,Route def update_recent(sender, instance, signal, *args, **kwargs): # Update recent entries static file @@ -20,13 +20,14 @@ def update_recent(sender, instance, signal, *args, **kwargs): qs = model.objects.filter(status__exact=1) cl = Country.objects.filter(visited=True).exclude(name='default') rl = Region.objects.all() - c = Context({'object_list':qs, 'country_list':cl,'region_list':rl}) + rtl = Route.objects.all() + c = Context({'object_list':qs, 'country_list':cl,'region_list':rl, 'route_list':rtl}) t = render_to_string('includes/map_entry_list_template.html',c) - fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/map_entry_list.html') + fpath = '%s%s' %(settings.PROJ_ROOT,'media/js/mainmap.js') file = codecs.open(fpath, 'w','utf8') file.write(t) file.close() - c = Context({'country_list':cl,'region_list':rl}) + c = Context({'country_list':cl,'region_list':rl,'route_list':rtl}) t = render_to_string('includes/map_sidebar_template.html',c) fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/map_sidebar.html') file = codecs.open(fpath, 'w','utf8') -- cgit v1.2.3