Ejemplo n.º 1
0
def get_all_cars_by_attribute(attribute_name, value):
    return [
        attribute for car in Customer.all() for attribute in car.cars
        if attribute[attribute_name] == value
    ]
def get_all_customers():
    return Customer.all()
Ejemplo n.º 3
0
def get_all_cars():
    car_list = [[car for car in customer.cars] for customer in Customer.all()
                if customer.cars]
    return [car for sub_list in car_list for car in sub_list]