route method headways() tweak 1.3

This commit is contained in:
Johnson Chetty 2012-10-05 16:29:11 +02:00
parent 3f4d479ffe
commit 5a2ac9d032

View File

@ -278,7 +278,7 @@ class Route(models.Model):
'slug': self.slug, 'slug': self.slug,
'distance': str(self.distance), 'distance': str(self.distance),
'url': self.get_absolute_url(), 'url': self.get_absolute_url(),
'headways': self.headways() 'headway': self.headways()
} }
def areas_passed(self): def areas_passed(self):
@ -323,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]