def new_appointment(): animals = animal_repository.select_all() owners = owner_repository.select_all() return render_template("appointments/new.html", animals=animals, owners=owners) return render_template("appointments/new.html")
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)
def index(): global search results = [] search_term = False animals = animal_repository.select_all() if search: results = [ animal for animal in animals if search.lower() in animal.name.lower() ] for result in results: treatment = treatment_repository.select(result) result.where(treatment) search_term = search search = False for animal in animals: treatment = treatment_repository.select(animal) animal.where(treatment) return render_template( "animals/index.html", title="Animals", animals=animals, results=results, search=search_term, )
def edit_customer(id): customer = customer_repository.select(id) animals = animal_repository.select_all() return render_template("/customers/edit.html", title="Edit Customer", customer=customer, all_animals=animals)
def home(): owners = owner_repository.select_all() animals = animal_repository.select_all() appointments = appointment_repository.select_all() return render_template('index.html', owners=owners, animals=animals, appointments=appointments)
def home(): owners = owner_repository.select_all() animals = animal_repository.select_all() vets = vet_repository.select_all() counts = {'owners':len(owners), 'animals':len(animals), 'vets':len(vets)} date_today = datetime.datetime.now().date() treatments = treatment_repository.select_all() treatments_today = [treatment for treatment in treatments if treatment.date == date_today] return render_template('index.html', treatments_today=treatments_today, counts=counts, title='Home')
def admitted(): animals = animal_repository.select_all() for animal in animals: treatment = treatment_repository.select(animal) animal.where(treatment) checked_in_animals = [animal for animal in animals if animal.checked_in] return render_template("animals/index.html", title="Animals", animals=checked_in_animals, admitted=True)
def index(): # something is wrong below im going to bed :) no_vets = False message = request.args.get('message') show_all = request.args.get('show_all') if vet_repository.select_all() == []: no_vets = True message = "No Vets Found, please add these first." # figure out how to pass a param here i can check for elif show_all == "True": all_animals = animal_repository.select_all() else: all_animals = animal_repository.select_all_active() # return render_template("animals/index.html.j2", all_animals=all_animals, animal_id=animal_id, message=message, action=action) return render_template("animals/index.html.j2", **locals())
def edit_vet(id): vet = vet_repository.select(id) all_animal = animal_repository.select_all() return render_template("employees/edit.html", all_animal=all_animal, vet=vet)
def view_list(): animals = animal_repository.select_all() return render_template('animals/index.html', all_animals=animals)
from models.animal import Animal from models.owner import Owner import repositories.animal_repository as animal_repository import repositories.owner_repository as owner_repository # animal_repository.delete_all() # owner_repository.delete_all() owner_1 = Owner("Geoff") owner_repository.save(owner_1) owner_2 = Owner("Clive") owner_repository.save(owner_2) owner_repository.select_all() animal_1 = Animal("Bear", "Gentle Ben", owner_1) animal_repository.save(animal_1) animal_2 = Animal("Ferret", "Nibbles", owner_1) animal_repository.save(animal_2) animal_3 = Animal("Rabbit", "Jessica", owner_2) animal_repository.save(animal_3) animal_4 = Animal("Hedgehog", "Spike", owner_2) animal_repository.save(animal_4) animal_repository.select_all() pdb.set_trace()
def index(): animals = animal_repository.select_all() return render_template('/animals/index.html', animals=animals, title='All Animals')
def animals(): animals = animal_repository.select_all() return render_template("/animals/index.html", all_animals= animals)
def new_animal(): owners = owner_repository.select_all() animals = animal_repository.select_all() return render_template("animals/new.html", owners=owners, animals=animals)
def edit_appointment(id): animals = animal_repository.select_all() appointment = appointment_repository.select(id) return render_template("appointments/edit.html", appointment=appointment, animals=animals)
def owner(): appointments = appointment_repository.select_all() animals = animal_repository.select_all() return render_template("appointments/index.html", all_appointments=appointments, animals=animals)
def animals(): all_animals = animal_repository.select_all() all_allergies = allergy_repository.select_all() return render_template("/allergys/index.html", all_animals=all_animals, all_allergies=all_allergies)
def animals(): animals = animal_repository.select_all() return render_template('index.html', animals=animals)