From 6b847ae566543440445ccd4b688c2d07c6db521d Mon Sep 17 00:00:00 2001 From: Sanj Date: Wed, 29 Feb 2012 02:17:38 +0530 Subject: [PATCH] order route by code --- chaloBEST/mumbai/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chaloBEST/mumbai/models.py b/chaloBEST/mumbai/models.py index bae603d..34945ad 100644 --- a/chaloBEST/mumbai/models.py +++ b/chaloBEST/mumbai/models.py @@ -204,7 +204,7 @@ class Stop(models.Model): class Route(models.Model): - code = models.TextField(max_length=255, unique=True) + code = models.TextField(max_length=255, unique=True) #FIXME: Why is this a TextField?? slug = models.SlugField(null=True) alias = models.TextField(max_length=255) from_stop_txt = models.TextField(max_length=500) @@ -214,6 +214,9 @@ class Route(models.Model): distance = models.DecimalField(max_digits=3, decimal_places=1) stages = models.IntegerField() + class Meta: + ordering = ['code'] + def get_absolute_url(self): return "/route/%s/" % self.alias