-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathrepository.py
More file actions
30 lines (23 loc) · 788 Bytes
/
repository.py
File metadata and controls
30 lines (23 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from bookings import Booking
from data_access.models import Booking as BookingModel
class BookingsRepository:
def __init__(self, session):
self.session = session
def get(self, **filters):
pass
def list(self):
return [
booking.dict() for booking in self.session.query(BookingModel).all()
]
def add(self, restaurant, date_time, party_size):
booking = BookingModel(
restaurant_id=restaurant,
date_time=date_time,
party_size=party_size,
)
self.session.add(booking)
return Booking(restaurant=booking.restaurant_id, date_time=booking.date_time, booking_record=booking)
def update(self, **kwargs):
pass
def delete(self, **kwargs):
pass