From e92fc98ab1452e1fb3bf11b6f4c666e247cbe4c7 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sun, 19 Feb 2012 19:02:27 +0530 Subject: [PATCH] add routes list to stop GET --- chaloBEST/mumbai/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/chaloBEST/mumbai/models.py b/chaloBEST/mumbai/models.py index 014949a..212ee1c 100644 --- a/chaloBEST/mumbai/models.py +++ b/chaloBEST/mumbai/models.py @@ -97,6 +97,7 @@ class Stop(models.Model): alt_names = generic.GenericRelation("AlternativeName") def get_dict(self): + routes = [r.route.alias for r in RouteDetail.objects.filter(stop=self)] return { 'id': self.id, 'code': self.code, @@ -105,7 +106,8 @@ class Stop(models.Model): 'display_name': self.display_name, 'road': self.road.name, 'area': self.area.name, - 'name_mr': self.name_mr + 'name_mr': self.name_mr, + 'routes': routes #FIXME: add alt names }