def create_manufacturer(): name = request.form['name'] location = request.form['location'] product_type = request.form['product_type'] manufacturer = Manufacturer(name, location, product_type) manufacturer_repository.save(manufacturer) return redirect('/manufacturers')
def create_manufacturer(): name = request.form['name'] phone = request.form['phone'] website = request.form['website'] email = request.form['email'] manufacturer = Manufacturer(name, phone, website, email) manufacturer_repository.save(manufacturer) return redirect('/manufacturers')
def create_manufacturer(): name = request.form["name"] address = request.form["address"] deactivated = request.form["deactivated"] manufacturer = Manufacturer(name, address, deactivated) manufacturer_repository.save(manufacturer) return redirect("/manufacturers")
def create_manufacturer(): name = request.form["name"] description = request.form["description"] category = request.form["category"] new_manufacturer = Manufacturer(name, description, category) new_manufacturer.activate() manufacturer_repository.save(new_manufacturer) return redirect("/manufacturers")
import pdb from models.item import Item from models.manufacturer import Manufacturer import repositories.item_repository as item_repository import repositories.manufacturer_repository as manufacturer_repository item_repository.delete_all() manufacturer_repository.delete_all() man_1 = Manufacturer("Lonely Mountain's Lost Halls", "Treasures raised from the roots of Lonely Mountain", "Gemstones") manufacturer_repository.save(man_1) man_2 = Manufacturer( "Iron Hills Forge", "The finest Dwarven armours, sealed with Dain Ironfoot's personal mark of approval", "Armour") manufacturer_repository.save(man_2) man_3 = Manufacturer("Murkwood's Ironbark Armoury", "The finest Elven steel and woodland weaponry", "Weapons") manufacturer_repository.save(man_3) man_4 = Manufacturer( "Nasty Bitza Kit", "Stabbas, choppas, cuttas! Nocked togevva by da Goblins ov Misty Mountain.", "Weapons") manufacturer_repository.save(man_4)
def create_manufacturer(): name = request.form['name'] contact = request.form['contact'] manufacturer = Manufacturer(name, contact) manufacturer_repository.save(manufacturer) return redirect('/manufacturers')
def create_manufacturer(): name = request.form["name"] country = request.form["country"] new_manufacturer = Manufacturer(name, country) manufacturer_repository.save(new_manufacturer) return redirect("/manufacturers")
from models.manufacturer import Manufacturer from models.product import Product import repositories.manufacturer_repository as manufacturer_repository import repositories.product_repository as product_repository product_repository.delete_all() manufacturer_repository.delete_all() manufacturer1 = Manufacturer("Chanel", "012345678") manufacturer_repository.save(manufacturer1) manufacturer2 = Manufacturer("Dior", "012345679") manufacturer_repository.save(manufacturer2) manufacturer3 = Manufacturer("Prada", "01568799") manufacturer_repository.save(manufacturer3) manufacturer4 = Manufacturer("Tom Ford", "0145682229") manufacturer_repository.save(manufacturer4) manufacturer5 = Manufacturer("Marc Jacobs", "0145684445") manufacturer_repository.save(manufacturer5) manufacturer6 = Manufacturer("Jo Malone", "0132684225") manufacturer_repository.save(manufacturer6) manufacturer7 = Manufacturer("Elizabeth Arden", "0152685635") manufacturer_repository.save(manufacturer7) product1 = Product("Chance", "Fresh", 20, 60, 70, manufacturer1)
import pdb from models.product import Product import repositories.product_repository as product_repository from models.manufacturer import Manufacturer import repositories.manufacturer_repository as manufacturer_repository manufacturer_repository.delete_all() product_repository.delete_all() manufacturer_1 = Manufacturer("Apple", "USA") manufacturer_repository.save(manufacturer_1) manufacturer_2 = Manufacturer("Samsung", "South Korea") manufacturer_repository.save(manufacturer_2) manufacturer_3 = Manufacturer("Google", "USA") manufacturer_repository.save(manufacturer_3) product_1 = Product("iPhone 11", "6.1 inches", "Black", 679.00, 779.00, 60, manufacturer_1.id) product_repository.save(product_1) product_2 = Product("iPhone X", "6.1 inches", "Space Grey", 379.00, 479.00, 70, manufacturer_1.id) product_repository.save(product_2) product_3 = Product("Galaxy S20", "6.2 inches", "Cloud Navy", 550.00, 799.00, 100, manufacturer_2.id) product_repository.save(product_3) product_4 = Product("Galaxy S10", "6.1 inches", "Ceramic Black", 450.00, 600.00, 30, manufacturer_2.id) product_repository.save(product_4)
import pdb from flask import Flask from models.manufacturer import Manufacturer from models.stock import Stock import repositories.manufacturer_repository as manufacturer_repository import repositories.stock_repository as stock_repository manufacturer_repository.delete_all() stock_repository.delete_all() manufacturer1 = Manufacturer("Onyxhand","Dustcounter") manufacturer_repository.save(manufacturer1) manufacturer2 = Manufacturer("Galan","Thetris") manufacturer_repository.save(manufacturer2) manufacturer3 = Manufacturer("Kormdek","Bronzebrowser") manufacturer_repository.save(manufacturer3) # name, description , manufacturer ,cost, price stock_1 = Stock("Bag of holding", "Wondrous Item", manufacturer1, 100 , 175) stock_repository.save(stock_1) stock_2 = Stock("Ivory Goat", "Wonderous Item", manufacturer1, 300, 424) stock_repository.save(stock_2)q stock_3 = Stock("Necklace Of Fireballs", "Wonderous Item", manufacturer2, 400, 510) stock_repository.save(stock_3) stock_4 = Stock("Ring Of Feather Falling", "Wonderous Item", manufacturer2, 2000, 3250) stock_repository.save(stock_4) stock_5 = Stock("Flame Tongue", "Weapon(greatsword)",manufacturer3, 4000,5550) stock_repository.save(stock_5) stock_6 = Stock("Vorpal Sword", "Weapon(legendary)",manufacturer3, 20000,45000)