def change_customer_attribute(customer_id, attribute_name, new_value):
    try:
        Customer.change_attribute(customer_id, attribute_name, new_value)
    except ValueError:
        print('Incorrect argument entered')
Ejemplo n.º 2
0
def change_car_attribute(car, attribute_name, new_value):
    value = Customer.find(**{'cars': car})[0].cars
    value[0].update({attribute_name: new_value})
    Customer.change_attribute(
        Customer.find(**{'cars': car})[0]._id, 'cars', value)