Пример #1
0
def view_wizard_items(id):
    wizard = wiz_repo.select(id)
    items = wiz_repo.select_all()
    return render_template('items/items.html',
                           title='Home',
                           wizard=wizard,
                           items=items)
Пример #2
0
def add_wizard():
    wizFirstName = request.form['first_name']
    wizLastName = request.form['last_name']
    wizAge = request.form['age']
    newWizard = Wizard(first_name=wizFirstName,
                       last_name=wizLastName,
                       age=wizAge)
    wiz_repo.save(newWizard)
    wizards = wiz_repo.select_all()
    return render_template('wizards/wizards.html',
                           title='Home',
                           wizards=wizards)
Пример #3
0
def home():
    wizards = wiz_repo.select_all()
    return render_template('wizards/wizards.html',
                           title='Home',
                           wizards=wizards)
Пример #4
0
def delete_wizard(id):
    wiz_repo.delete(id)
    wizards = wiz_repo.select_all()
    return render_template('wizards/wizards.html',
                           title='Home',
                           wizards=wizards)
Пример #5
0
location_repository.save(location1)
location2 = Location("Arthur's Seat", "Natural Wonder", "Edinburgh")
location_repository.save(location2)

spell1 = Spell("Ripe Old Mage", "Age Acceleration", wizard1)
spell_repository.save(spell1)
spell2 = Spell("Spell The Beans", "Relentless Honesty", wizard2)
spell_repository.save(spell2)
spell3 = Spell("Wiccapedia", "Downloads entire Wikipedia server to brain, explosion.", wizard2)
spell_repository.save(spell3)

cast1 = Cast(5,"5 People Aged Beyond Saving", wizard2, spell1, location1)
cast_repository.save(cast1)

locations = location_repository.select_all()
wizards = wizard_repository.select_all()
spells = spell_repository.select_all()
casts = cast_repository.select_all()

# Testing Update Wizard (Change Age)
wizard_update = Wizard("Gandalferoo", "DePurple", 3000, wizard1.id)
wizard_repository.update(wizard_update)

# Testing Update Spell (Changed Wizard)
spell_update = Spell("Spell The Beans", "Relentless Honesty", wizard3, spell1.id)
spell_repository.update(spell_update)

# Testing Update Location (Changed Supermarket Name)
location_update = Location("Lidl", "Supermarket", "Mordor", location1.id)
location_repository.update(location_update)