From 75540030884d8cf4514a1f0d59f8bbab90452f29 Mon Sep 17 00:00:00 2001 From: Sanj Date: Tue, 15 May 2012 21:00:48 +0530 Subject: [PATCH] remove select_related call --- chaloBEST/mumbai/apiviews.py | 4 ++-- chaloBEST/mumbai/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chaloBEST/mumbai/apiviews.py b/chaloBEST/mumbai/apiviews.py index 0016866..dbafba8 100644 --- a/chaloBEST/mumbai/apiviews.py +++ b/chaloBEST/mumbai/apiviews.py @@ -67,9 +67,9 @@ def areas(request): def stops(request): q = request.GET.get("q", "") if q != '': - qset = Stop.objects.find_approximate(q, TRIGRAM_THRESHOLD).select_related('road', 'area') + qset = Stop.objects.find_approximate(q, TRIGRAM_THRESHOLD) else: - qset = Stop.objects.all().select_related('road', 'area') + qset = Stop.objects.all() srid = int(request.GET.get("srid", 4326)) return render_to_json_response({ 'type': 'FeatureCollection', diff --git a/chaloBEST/mumbai/models.py b/chaloBEST/mumbai/models.py index 74c4462..4ab7929 100644 --- a/chaloBEST/mumbai/models.py +++ b/chaloBEST/mumbai/models.py @@ -160,7 +160,7 @@ class Stop(models.Model): 'direction': self.dbdirection, 'routes': ", ".join([r.alias for r in routes]), 'alternative_names': ", ".join([a.name for a in self.alt_names.all().filter(typ='common')]), - 'url': self.get_absolute_url() + 'url': self.get_absolute_url() } def get_geojson(self, srid=4326):