def edit_animal(id):
    animal = animal_repository.select(id)
    customers = customer_repository.select_all()
    return render_template("/animals/edit.html",
                           title="Edit Animal",
                           animal=animal,
                           all_customers=customers)
def customers():
    customers = customer_repository.select_all()
    # customers_animals = customer_repository.display_customer_animals(id)
    animals = animal_repository.select_all()
    return render_template("/customers/index.html",
                           all_animals=animals,
                           all_customers=customers)
Ejemplo n.º 3
0
def new_order():
    orders = order_repository.select_all()
    customers = customer_repository.select_all()
    restaurants = restaurant_repository.select_all()
    dishes = dish_repository.select_all()
    return render_template("/orders/new.html",
                           orders=orders,
                           customers=customers,
                           restaurants=restaurants,
                           dishes=dishes)
Ejemplo n.º 4
0
def edit_order(order_id):
    order = order_repository.select(order_id)
    restaurants = restaurant_repository.select_all()
    customers = customer_repository.select_all()
    dishes = dish_repository.select_all()
    order_dishes = order_dish_repository.select_all()
    return render_template('orders/edit.html',
                           order=order,
                           restaurants=restaurants,
                           customers=customers,
                           dishes=dishes,
                           order_dishes=order_dishes)
def new_customer():
    customers = customer_repository.select_all()
    return render_template("/customers/new.html",
                           all_customers=customers,
                           title='Customers')
def new_animal():
    customers = customer_repository.select_all()
    return render_template("/animals/new.html",
                           all_customers=customers,
                           title='Animals')
def animals():
    animals = animal_repository.select_all()
    customers = customer_repository.select_all()
    return render_template("/animals/index.html",
                           all_animals=animals,
                           all_customers=customers)
Ejemplo n.º 8
0
from models.customer import Customer

import repositories.animal_repository as animal_repository
import repositories.customer_repository as customer_repository

animal_repository.delete_all()
customer_repository.delete_all()

muran = Customer("Muran Battison", "07957941877")
customer_repository.save(muran)

zero = Animal("Zero", "13/10/2018", "Dog", "Visited to recieve yearly jab",
              muran)
animal_repository.save(zero)
bill = Animal("Bill", "13/10/2018", "Dog", "Visited to recieve yearly jab",
              muran)
animal_repository.save(bill)
lila = Animal("Lila", "13/10/2018", "Dog", "Visited to recieve yearly jab",
              muran)
animal_repository.save(lila)

res = customer_repository.select_all()
res2 = animal_repository.select_all()

for customer in res:
    print(customer.__dict__)

customer_repository.update(muran)

pdb.set_trace()
Ejemplo n.º 9
0
def new_customer():
    customers = customer_repository.select_all()
    return render_template("customers/new.html", customers=customers)
Ejemplo n.º 10
0
def customers():
    customers = customer_repository.select_all()
    return render_template("/customers/index.html", customers=customers)