Mercurial > public > sg101
changeset 838:f31168465953
Bandmap: make lat/lon editable for tweaking location markers.
Don't cache band results in debug mode.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 04 Oct 2014 16:40:17 -0500 |
parents | 234726f5a47a |
children | 36d988b800c2 |
files | bandmap/admin.py bandmap/views.py |
diffstat | 2 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/bandmap/admin.py Sat Oct 04 13:43:22 2014 -0500 +++ b/bandmap/admin.py Sat Oct 04 16:40:17 2014 -0500 @@ -18,7 +18,7 @@ 'is_active', 'is_approved'] date_hierarchy = 'date_submitted' list_filter = ['date_submitted', 'is_active', 'is_approved'] - readonly_fields = ['lat', 'lon'] + list_editable = ['lat', 'lon'] search_fields = ['name', 'location', 'note'] raw_id_fields = ['user'] actions = ['update_location', 'approve_bands']
--- a/bandmap/views.py Sat Oct 04 13:43:22 2014 -0500 +++ b/bandmap/views.py Sat Oct 04 16:40:17 2014 -0500 @@ -9,6 +9,7 @@ from django.http import HttpResponse from django.template.loader import render_to_string from django.core.cache import cache +from django.conf import settings from bandmap.forms import BandForm from bandmap.models import BandEntry @@ -54,7 +55,7 @@ # Do we have the results cached already? cache_key = 'bandmap-results-{}'.format(show_param) results = cache.get(cache_key) - if results: + if results and not settings.DEBUG: return HttpResponse(results, content_type='application/json') # Generate results