def my_trips(self):
     # trippies = []
     # for going in Trip.all():
     #     if going.driver == self:
     #         trippies.append(going)
     # return trippies
     return [going for going in Trip.all() if going.driver == self]
Exemple #2
0
 def drivers(self):
     return [
         drive.driver for drive in Trip.all() if drive.passenger == self
     ]
Exemple #3
0
 def trips(self):
     return [drive for drive in Trip.all() if drive.passenger == self]
 def passengers(self):
     return [item.passenger for item in Trip.all() if item.driver == self]
 def trips(self):
     return [item for item in Trip.all() if item.driver == self]
 def test_trip_class_method(self):
     self.assertItemsEqual(Trip._all, [trip_1, trip_2, trip_3])
     self.assertItemsEqual(Trip.all(), [trip_1, trip_2, trip_3])
Exemple #7
0
 def trips(self):
     return [item for item in Trip.all() if item.passenger == self]
Exemple #8
0
 def trips(self, type):
     return [drive for drive in Trip.all() if drive.type == self]
 def my_trips(self):
     return list(
         filter(lambda trip: (vars(trip))['_driver'] == self, Trip.all()))
 def my_trips(self):
     return [trip for trip in Trip.all() if self == trip.driver]
 def my_trip_summaries(self):
     return [trip.start + ' to ' + trip.destination for trip in Trip.all() if self == trip.driver]
 def my_trips(self):
     return [trip for trip in Trip.all() if trip._driver.name == self.name]
 def my_trip_summaries(self):
     return [trip.start + " to " + trip.destination for trip in Trip.all() if trip.driver == self]
     pass
 def my_trips(self):
     return [trip for trip in Trip.all() if trip.driver == self]
     pass
 def passengers(self):
     return [trip.passenger for trip in Trip.all() if trip.driver == self]
Exemple #16
0
 def trips(self):
     return [trip for trip in Trip.all() if trip.passenger == self]