This commit is contained in:
Sanj 2012-10-05 19:53:51 +05:30
commit 79e484f89d

View File

@ -277,7 +277,8 @@ class Route(models.Model):
'alias': self.alias, 'alias': self.alias,
'slug': self.slug, 'slug': self.slug,
'distance': str(self.distance), 'distance': str(self.distance),
'url': self.get_absolute_url() 'url': self.get_absolute_url(),
'headway': self.headways()
} }
def areas_passed(self): def areas_passed(self):
@ -306,8 +307,6 @@ class Route(models.Model):
("11:00:00","16:59:59"), ("11:00:00","16:59:59"),
("17:00:00","19:59:59"), ("17:00:00","19:59:59"),
("20:00:00", None)) ("20:00:00", None))
import pdb
pdb.set_trace()
freqs=[] freqs=[]
for s in scheds: for s in scheds:
@ -324,9 +323,8 @@ class Route(models.Model):
return None return None
frequencies = [x for x in freqs if x!=0] frequencies = [x for x in freqs if x!=0]
return { return str(min(frequencies)) + "-" + str(max(frequencies)) if min(frequencies)!=max(frequencies) else str(max(frequencies))
'frequency': str(min(frequencies)) + "-" + str(max(frequencies)) if min(frequencies)!=max(frequencies) else str(max(frequencies))
}
#'scheds': [ (s.headway1, s.headway2, s.headway3, s.headway4, str(s.unique_route) ) for s in scheds] #'scheds': [ (s.headway1, s.headway2, s.headway3, s.headway4, str(s.unique_route) ) for s in scheds]