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]))
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)
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
def last_stop(self,obj): return services.get_heb_stop_name(obj.stop_ids[-1])
def first_stop(self,obj): return services.get_heb_stop_name(obj.stop_ids[0])
def last_stop(self, obj): return services.get_heb_stop_name(obj.stop_ids[-1])
def first_stop(self, obj): return services.get_heb_stop_name(obj.stop_ids[0])