From a0e0c908aaa2f6cbd8065f143d451aa8c8140bbe Mon Sep 17 00:00:00 2001 From: Flavio Curella Date: Thu, 19 Dec 2024 12:08:32 -0600 Subject: [PATCH] fix __repr__ methods --- django/db/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/db/utils.py b/django/db/utils.py index 8b1f0cbc0e..5a1a95825b 100644 --- a/django/db/utils.py +++ b/django/db/utils.py @@ -219,7 +219,7 @@ class AsyncAlias: return ", ".join([str(id(conn)) for conn in self.connections]) def __repr__(self): - return f"<{self.__class__.__name__}: {self}>" + return f"<{self.__class__.__name__}: {len(self.connections)} connections>" def add_connection(self, connection): setattr(self._connections, "_stack", self.connections + [connection]) @@ -251,7 +251,7 @@ class AsyncConnectionHandler: return async_alias def __repr__(self) -> str: - return f"<{self.__class__.__name__}: {self}>" + return f"<{self.__class__.__name__}: {self.count} connections>" @property def count(self):