From 3477c03d8b130fd67cca5787b0f727fb0f89c0ae Mon Sep 17 00:00:00 2001 From: consarnproject <132343102+consarnproject@users.noreply.github.com> Date: Wed, 18 Jun 2025 12:17:24 +0200 Subject: [PATCH] Update __repr__() method models.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I chose this additional piece of code (which.. "makes an attempt to return a string that would yield an object with the same value when passed to eval()") because models and test_crud are important in order to have the testing phase of this application work correctly. In the testing phase it is important to have access to printable versions of objects to see and determine what they contain. It is important to be able to easily access what an object contains easily via printing so that at any point of the complex process of testing, the developer can refer to and “evaluate” any object in the correct way. --- fastapi-postgres/application/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fastapi-postgres/application/models.py b/fastapi-postgres/application/models.py index 05dd1eb..152fea3 100644 --- a/fastapi-postgres/application/models.py +++ b/fastapi-postgres/application/models.py @@ -11,3 +11,6 @@ class Student(Base): email = Column(String, name="Email", index=True) password = Column(String, name="Hashed Password") stream = Column(String, name="Subject Stream", default="Mathematics") + + def __repr__(self): + return f""