Ejemplo n.º 1
0
def add_car():
    model = input("What is the model? ")
    make = 'Ferrari'  # input("What is the make? ")
    year = int(input("Year built? "))

    car = Car()
    car.year = year
    car.make = make
    car.model = model

    engine = Engine()
    engine.horsepower = 700
    engine.mpg = 20
    engine.liters = 4.0

    car.engine = engine

    car.save()
def add_car():
    model = input("What is the model? ")
    make = 'Ferrari'  # input("What is the make? ")
    year = int(input("Year built? "))

    car = Car()
    car.year = year
    car.make = make
    car.model = model

    engine = Engine()
    engine.horsepower = 590
    engine.mpg = 22
    engine.liters = 4.0

    car.engine = engine

    car.save()
Ejemplo n.º 3
0
def add_car():
    model = input('What is the model: ')
    make = input('What is the make: ')
    year = int(input('Year built?: '))

    car = Car()
    car.year = year
    car.make = make
    car.model = model

    engine = Engine()
    engine.horsepower = 590
    engine.mpg = 22
    engine.liters = 4.0

    car.engine = engine

    car.save()
Ejemplo n.º 4
0
def add_car():
    model = input('What is the model? ')
    make = input('What is the make? ')
    year = int(input('Year built? '))
    # mileage = float(input('Mileage? '))
    # vin = input('VIN? ')

    car = Car()
    car.model = model
    car.make = make
    car.year = year
    # car.mileage = mileage
    # car.vi_number = vin

    engine = Engine()
    engine.horsepower = 600
    engine.mpg = 20
    engine.liters = 5.0

    car.engine = engine  # equals to an object

    car.save(
    )  # in order to insert it to db in active record style, where we work with a single document