Version
v2
Impact
High
Suggested Priority
High
Description
At the moment, when printing a "Booking" object, we get back a result of an object type. Even though that doesn't necessarily affect the way the application is running at the moment, it could cause problems in the future when debugging.
To identify the issue, follow the steps below.
In the CLI run:
- python3
- from lib.booking import Booking
- booking = Booking(135, "2024-06-05 21:21", 1, 2, 3)
- booking
You will get a result similar to this:
<lib.booking.Booking object at 0x1047a61e0>
To fix this I suggest adding a repl method in the booking.py:
_def __repr__(self):
return f"Booking({self.id}, {self.dt}, {self.gid_id}, {self.user_id}, {self.ticket_count})"_
If afer adding the repl method we repeat the steps in the REPL, we should now be getting the result below:
Booking(135, "2024-06-05 21:21", 1, 2, 3)
Version
v2
Impact
High
Suggested Priority
High
Description
At the moment, when printing a "Booking" object, we get back a result of an object type. Even though that doesn't necessarily affect the way the application is running at the moment, it could cause problems in the future when debugging.
To identify the issue, follow the steps below.
In the CLI run:
You will get a result similar to this:
<lib.booking.Booking object at 0x1047a61e0>
To fix this I suggest adding a repl method in the booking.py:
If afer adding the repl method we repeat the steps in the REPL, we should now be getting the result below:
Booking(135, "2024-06-05 21:21", 1, 2, 3)