remove select_related call

This commit is contained in:
Sanj 2012-05-15 21:00:48 +05:30
parent c6894cccef
commit 7554003088
2 changed files with 3 additions and 3 deletions

View File

@ -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',

View File

@ -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):