예제 #1
0
    def get_short_name(self):
        import services

        return '%s %s: %s %s %s' % (_('Route'),
                                    self.id,
                                    services.get_heb_stop_name(self.stop_ids[0]),
                                    '↜',
                                    services.get_heb_stop_name(self.stop_ids[-1]))
예제 #2
0
    def admin_unicode(self):
        import services

        first_stop_name = services.get_heb_stop_name(self.stop_ids[0])
        last_stop_name = services.get_heb_stop_name(self.stop_ids[-1])

        result = '%s: %s stops from %s to %s' % (self.id,
                                                 len(self.stop_ids),
                                                 first_stop_name,
                                                 last_stop_name,
        )
        return unicode(result)
예제 #3
0
    def get_stops(self):
        import services

        trip = self.trips.first()
        samples = trip.get_real_stop_samples()
        result = []
        for sample in samples:
            result.append({
                'stop_id': sample.stop_id,
                'stop_name': services.get_heb_stop_name(sample.stop_id),
                'exp_arrival': sample.to_local_str_hm(sample.exp_arrival, ':'),
                'exp_departure': sample.to_local_str_hm(sample.exp_departure, ':'),
            })
        return result
예제 #4
0
 def last_stop(self,obj):
     return services.get_heb_stop_name(obj.stop_ids[-1])
예제 #5
0
 def first_stop(self,obj):
     return services.get_heb_stop_name(obj.stop_ids[0])
예제 #6
0
 def last_stop(self, obj):
     return services.get_heb_stop_name(obj.stop_ids[-1])
예제 #7
0
 def first_stop(self, obj):
     return services.get_heb_stop_name(obj.stop_ids[0])