1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

fix __repr__ methods

This commit is contained in:
Flavio Curella 2024-12-19 12:08:32 -06:00
parent 96ec4b1004
commit a0e0c908aa
No known key found for this signature in database
GPG Key ID: 1AD0556F485696BF

View File

@ -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):