def create_activity(): name = request.form['name'] date = request.form['date'] time = request.form['time'] trainer = trainer_repository.select(request.form['trainer']) capacity = request.form['capacity'] activity = Activity(name, date, time, trainer, capacity) activity_repository.save(activity) return redirect("/activities")
def create_activity(): gym_id = request.form['gym'] activity_type = request.form['activity_type'] duration = request.form['duration'] difficulty = request.form['difficulty'] gym = gym_repository.select(gym_id) activity = Activity(gym, activity_type, duration, difficulty) activity_repository.save(activity) return redirect("/all-activities")
def create_activity(): name = request.form["name"] photo = request.files["photo"].filename trainer = request.form["trainer"] activity = Activity(name, photo, trainer) activity_repository.save(activity) return redirect('/activities')
def create_activity(): name = request.form["name"] venue = request.form["venue"] category = request.form["category"] capacity = request.form["capacity"] finished = request.form["finished"] offpeak = request.form["offpeak"] new_activity = Activity(name, venue, category, capacity, finished, offpeak) activity_repository.save(new_activity) return redirect("/activities")
def create_activity(): activity_name = request.form["name"] try: upcoming = request.form["upcoming"] except: upcoming = False new_activity = Activity(activity_name, upcoming) activity_repository.save(new_activity) return redirect("/activities")
renfri = Member("Renfri", "of Creyden", "basic") striga = Member("Striga", "the Monster", "pro") member_repository.save(geralt) member_repository.save(ciri) member_repository.save(yennefer) member_repository.save(tris) member_repository.save(renfri) member_repository.save(striga) emotions = Activity("Emotions Yoga", "Djinn's Bottle", "hollistic", 12, False, True) sword = Activity("Sword Fighting", "Kaer Morhen", "essentials", 2, False, True) spells = Activity("Spells", "Aretuza", "magic", 6, False, False) claws = Activity("Claws Shredding", "Vizima", "monstery arts", 1, True, False) activity_repository.save(emotions) activity_repository.save(sword) activity_repository.save(spells) activity_repository.save(claws) booking_1 = Booking(geralt, emotions) booking_2 = Booking(ciri, sword) booking_3 = Booking(yennefer, spells) booking_4 = Booking(tris, spells) booking_5 = Booking(ciri, spells) booking_6 = Booking(striga, claws) booking_7 = Booking(renfri, sword) booking_8 = Booking(renfri, claws) booking_repository.save(booking_1)
member7 = Member("Frank", "Booth", "1957-02-12", "m_frank_booth.jpg", "Basic") member_repository.save(member7) member8 = Member("Jenny", "Fromtheblock", "1972-05-23", "m_jenny_fromtheblock.jpg", "Platinum") member_repository.save(member8) member9 = Member("Jonah", "Hole", "1977-07-26", "m_jonah_hole.jpg", "Basic") member_repository.save(member9) member10 = Member("Kayode", "Ewumil", "1972-07-26", "m_kayode_ewumil.jpg", "Basic") member_repository.save(member10) activity1 = Activity("Spinning", "spinning.jpg", "Baldi") activity_repository.save(activity1) activity2 = Activity("Weights", "weights.jpg", "Mario") activity_repository.save(activity2) activity3 = Activity("Aikido", "class_aikido.jpg", "Steven") activity_repository.save(activity3) activity4 = Activity("Archert", "class_archery.jpg", "Robin") activity_repository.save(activity4) activity5 = Activity("Balet", "class_balet.jpg", "Michail") activity_repository.save(activity5) activity6 = Activity("Boxing", "class_boxing.jpg", "Mike") activity_repository.save(activity6)
import repositories.activity_repository as activity_repository import repositories.booking_repository as booking_repository import repositories.member_repository as member_repository import repositories.trainer_repository as trainer_repository activity_repository.delete_all() member_repository.delete_all() trainer_repository.delete_all() booking_repository.delete_all() trainer1 = Trainer('Tron') trainer_repository.save(trainer1) swimclass = Activity('Swim class', '2020-01-01', '18:00', trainer1, 30) activity_repository.save(swimclass) weightclass = Activity('Weights class', '2020-04-16', '12:00', trainer1, 20) activity_repository.save(weightclass) member1 = Member('Thom') member_repository.save(member1) booking1 = Booking(member1, swimclass) booking_repository.save(booking1) booking2 = Booking(member1, weightclass, 'I might be late. Sorry!') booking_repository.save(booking2) bookings = booking_repository.select_all()
member_repository.delete_all() activity_repository.delete_all() booking_repository.delete_all() member1 = Member("Bojo the Imbecile") member_repository.save(member1) member2 = Member("Pretty-unkind Patel") member_repository.save(member2) member3 = Member("Lyca Sturgeon") member_repository.save(member3) member4 = Member("Dumpy Truck") member_repository.save(member4) activity1 = Activity("Compassion Cultivator", True) activity_repository.save(activity1) activity2 = Activity("Empathy Stretcher", False) activity_repository.save(activity2) activity3 = Activity("Kundalini Kindness", True) activity_repository.save(activity3) activity4 = Activity("Political Punch Class", False) activity_repository.save(activity4) # activity_repository.select_all() # member1 = Member("Bojo The Imbecile") # member_repository.update(member1) # activity1 = Activity("Compassion Crunches", False) # activity_repository.update(activity1)
import repositories.gym_repository as gym_repository import repositories.customer_repository as customer_repository import repositories.activity_repository as activity_repository activity_repository.delete_all() customer_repository.delete_all() gym_repository.delete_all() gym_1 = Gym('Chromerias Gym') gym_repository.save(gym_1) gym_2 = Gym('MAXIMUM Gym') gym_repository.save(gym_2) activity_1 = Activity(gym_1, 'Running', 60, 'INTENSE') activity_repository.save(activity_1) customer_1 = Customer('Kip Gyle', 'Premium', gym_1) customer_repository.save(customer_1) customer_2 = Customer('Gavin Gyle', 'Standard', gym_1) customer_repository.save(customer_2) customer_3 = Customer('Karris White', 'Standard', gym_2) customer_repository.save(customer_3) customer_4 = Customer('Kylar Stern', 'Standard', gym_2) customer_repository.save(customer_4) pdb.set_trace()