app factory now outside tests dir, other minor changes
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user