session = DBSession()

# Create dummy user
User1 = User(name="Hello", email="*****@*****.**", password="******", id=0)
session.add(User1)
session.commit()

user_id = session.query(User).filter_by(email="*****@*****.**").one().id

models = {
    'Cars': ['Fiesta', 'Mustang', 'Taurus'],
    'SUVs': ['Escape', 'Edge', 'Explorer'],
    'Trucks': ['Ranger', 'F150', 'Super Duty'],
    'Hybrids': ['Fusion']
}

names = list(models.keys())

for i in range(len(names)):
    cat = Category(name=names[i], user_id=user_id)
    session.add(cat)
    session.commit()
    category_id = session.query(Category).filter_by(name=names[i]).one().id
    for j in range(len(models[names[i]])):
        newModel = Model(name=models[names[i]][j],
                         user_id=user_id,
                         category_id=category_id,
                         description='')
        session.add(newModel)
        session.commit()
Example #2
0
session = DBSession()

# Create dummy user
User1 = User(name="fady maged", email="*****@*****.**")
session.add(User1)
session.commit()

# BMW
brand1 = Brand(user_id=1, name="BMW")

session.add(brand1)
session.commit()

menuItem2 = Model(user_id=1,
                  name="118i",
                  description="bmw first series ",
                  price="$20000",
                  cc="1800cc",
                  brand=brand1)

session.add(menuItem2)
session.commit()

menuItem1 = Model(user_id=1,
                  name="220",
                  description="bmw second series",
                  price="$22000",
                  cc="2000cc",
                  brand=brand1)

session.add(menuItem1)
session.commit()
Example #3
0
# Add myself as a User
user = User(name="Cory Richard", email="*****@*****.**")
session.add(user)
session.commit()

# Add Brand and Models
brand = Brand(name="Acura", user=user)

session.add(brand)
session.commit()

model1 = Model(
    name="RDX",
    description=
    """The 2018 Acura RDX debuts with its third generation, being faster, with premium cabin space and first-class cargo space, as well as a host of new Acura revolutionary technologies. Designed, developed and manufactured in America, the new RDX turbocharged will launch the fastest, best handling and most luxurious RDX ever. The new Acura RDX is powered by a turbocharged direct injection engine with a displacement of 2.0-liters, with DOHC VTEC and Dual Variable Timing Cam (Dual VTC). The maximum power is 272 hp (202 Kw) and 380 Nm (280 lb-ft) of torque.""",  # noqa
    image="acura_rdx.jpg",
    brand=brand,
    user=user)

model2 = Model(
    name="RLX",
    description=
    """A redesigned Acura RLX large sedan was unveiled for 2018, overhauled to reflect the brand's new Precision Crafted Performance orientation in every detail. Said to be the most sophisticated and best performing Acura sedan to date, the 2018 model year RLX is fitted with the Sport Hybrid Super-Handling All-Wheel Drive technology also shared with the NSX supercar. Standard features on the 2018 RLX Sport Hybrid include premium Krell Audio System, Surround View Camera, parking sensors, LED fog lights, remote engine start, ventilated and heated front seats, heated rear seats and steering wheel and more.""",  # noqa
    brand=brand,
    image="acura_rlx.jpg",
    user=user)

model3 = Model(
    name="NSX",
    description=
Example #4
0
    user_id=1,
    name='Acura',
    description=
    'Acura is the American luxury vehicle marque of Japanese automaker Honda. The brand was launched in the United States and Canada on 27 March 1986, marketing luxury, performance, and high-performance vehicles.',
    image=
    'https://images.fineartamerica.com/images/artworkimages/mediumlarge/1/acura-logo-eva-sartiyem.jpg'
)

session.add(make1)
session.commit()

modelCar1 = Model(
    user_id=1,
    name='ILX',
    description=
    'Meticulously-crafted with a stunning new A-Spec variant, this powerfully-styled premium sport sedan features an aggressive exterior re-design, along with a beautiful interior wrapped in Milano Leather and Ultrasuede trim. Inside and out, the ILX was tailor made for you.',
    price='$25,900',
    image=
    'https://www.acura.com/-/media/Acura-Platform/Vehicle-Pages/ILX/2019/overview-page/Hero-and-Parallax/03-showroom/ILX_2019_Quick_On_Its_Feet_M.jpg',
    make=make1)

session.add(modelCar1)
session.commit()

modelCar2 = Model(
    user_id=1,
    name='TLX',
    description=
    'With so many premium features, the 2020 Acura TLX is the best sport sedan for those who like to have it all.',
    price='33,000',
    image=
Example #5
0
    picture=
    'https://pbs.twimg.com/profile_images/2671170543/18debd694829ed78203a5a36dd364160_400x400.png'
)
session.add(Manager1)
session.commit()

# Manager 1 Brand
brand1 = Brand(manager_id=1, name="BMW")
session.add(brand1)
session.commit()

# Add Model To The Brand
model1 = Model(name="8 Series Coupe",
               description='''Pulse-racing acceleration made to measure: the
               new BMW 8 Series Coupe combines the character of a sports car
               with the spirit of the BMW luxury class, creating a new form of
               aesthetics.''',
               price="25000",
               brand_id=brand1.id,
               manager_id=1)
session.add(model1)
session.commit()

model2 = Model(name="X5 Series",
               description='''The boss is here and puts everyone in their
               place: the new BMW X5. Its presence is written all over its
               face principled, powerful and elegant. The potent one-piece
               double kidney gives you an idea of what happens when it takes
               a deep breath. And the heightened X design of the headlights
               leaves no doubt about who is in the driving seat.''',
               price="24000",
               brand_id=brand1.id,
session.add(User1)
session.commit()

# Musical Instrument Guitar
MusicalInstrument1 = MusicalInstrument(
    user_id=1,
    name="Guitar",
    availableColors="Red,White,Black,Sunburst,Blue,Green,Natural")

session.add(MusicalInstrument1)
session.commit()

model1 = Model(
    user_id=1,
    name="Gibson 2016 Les Paul Studio HP Electric Guitar",
    description=
    "The 2016 Les Paul Studio HP is the supercharged counterpart of the traditional Les Paul Studio, and introduces an advanced set of premium, high-performance features to the format, including a new and exclusive fast-access heel, developed specifically for the Gibson USA High Performance lineup, to allow unprecedented access to the high notes - which, combined with the new soloist neck width, provides the fastest and most comfortable Les Paul Studio neck you’ve ever played.",
    price="$1,659.00",
    color="Sunburst",
    musicalInstrument=MusicalInstrument1)

session.add(model1)
session.commit()

model2 = Model(
    user_id=1,
    name=
    "Fender American Professional Stratocaster Maple Fingerboard Electric Guitar",
    description=
    "Often copied, but never surpassed, the Stratocaster is arguably the world’s most-loved electric guitar. Electrifying the music world since its debut in 1954, its natural, versatile sound made the Stratocaster the benchmark for exceptional guitar tones. The American Professional Stratocaster isn’t a re-imagining of the classic design; it’s the authentic original model, evolved.The choice of musical legends since its release, the Stratocaster feel and sound set the world on fire, powering music movements from electric blues to EDM, and everything in-between. In your hands this Strat is ready to navigate the creative twists and turns of your music, inspiring you to express yourself in new ways through your playingDeveloped by pickup master Tim Shaw, the brand-new V-Mod single-coil pickups are voiced specifically for each position, mixing alnico magnet types to produce powerful, nuanced tones with original Fender sonic DNA. Retain high-end clarity when adjusting the volume controls, thanks to the new treble-bleed tone circuit that lets your tone shine through in all its glory. The new modern “Deep C”-shaped neck profile feels just right in your hand while the narrow-tall frets make it easy to bend strings accurately and play perfectly intonated chords.The best of yesterday and today, the American Professional Stratocaster is the latest form of electric inspiration from Fender. Step up and stake your claim to a legend.",
    price="$1,399.99",
    color="Red",
Example #7
0
             "2671170543/18debd694829ed78203a5a36dd364160_400x400.png")
session.add(User1)
session.commit()

# Menu(list of player) for Country India

cloth1 = Cloth(name="Kids", user_id=1)
session.add(cloth1)
session.commit()

# Model List info
model1 = Model(
    name="Frock",
    price="500",
    color="red",
    pic=
    "https://cdn.shopify.com/s/files/1/1083/6796/products/product-image-854828235_1024x1024.jpg?v=1543642880",
    brand="shein",
    model_id=1,
    user_id=1)
session.add(model1)
session.commit()

model2 = Model(
    name="Shirt",
    price="1000",
    color="blue",
    pic=
    "https://i5.walmartimages.com/asr/9fac9355-4150-466a-aed0-6193125059bd_1.a8a78cf81c754b2aae0e07c9292e50b4.jpeg",
    brand="lauren",
    model_id=1,