app factory now outside tests dir, other minor changes

This commit is contained in:
2024-05-02 19:08:54 -04:00
parent d487e40c1e
commit 970f1fa0c8
8 changed files with 120 additions and 63 deletions

View File

@@ -20,13 +20,16 @@ class User(db.Model):
def __repr__(self):
return f'{self.username}'
# Get all dogs currently set
def get_dogs(self):
return [dog for dog in self.dogs]
# Retrieve all booked visits
def get_bookings(self):
def get_visits(self):
return [visit for visit in self.visits]
# Retrieve past booked visits
def get_bookings_history(self):
from datetime import datetime
def get_visit_history(self):
current_time = datetime.now()
return [visit for visit in self.visits if visit.date_time < current_time]