comparison bandmap/views.py @ 831:0f9c014c8adc

Bandmap: don't need to send URL to javascript client. Also tweaking note as I am noticing it isn't getting rendered correctly on all bands for some reason.
author Brian Neal <bgneal@gmail.com>
date Sun, 28 Sep 2014 20:42:57 -0500
parents b9973588af28
children f31168465953
comparison
equal deleted inserted replaced
830:b9973588af28 831:0f9c014c8adc
64 elif show_param == 'inactive': 64 elif show_param == 'inactive':
65 qs = qs.filter(is_active=False) 65 qs = qs.filter(is_active=False)
66 66
67 bands = [] 67 bands = []
68 for band in qs.iterator(): 68 for band in qs.iterator():
69 note = render_to_string('bandmap/balloon.html', {'band': band})
70 note = note.strip().replace('\n', '')
69 bands.append({ 71 bands.append({
70 'name': band.name, 72 'name': band.name,
71 'url': band.url,
72 'lat': band.lat, 73 'lat': band.lat,
73 'lon': band.lon, 74 'lon': band.lon,
74 'is_active': band.is_active, 75 'is_active': band.is_active,
75 'note': render_to_string('bandmap/balloon.html', {'band': band}), 76 'note': note,
76 }) 77 })
77 results = json.dumps(bands) 78 results = json.dumps(bands)
78 79
79 # Store in cache 80 # Store in cache
80 cache.set(cache_key, results, 300) 81 cache.set(cache_key, results, 300)