From 6fa2930573ff862a7f8ae8a11aa8bb7253fddeb7 Mon Sep 17 00:00:00 2001 From: Jonny Park Date: Fri, 26 Mar 2021 16:14:09 +0900 Subject: Refs #24121 -- Added __repr__() to BaseDatabaseWrapper, JoinPromoter, and SQLCompiler. --- django/db/models/sql/compiler.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'django/db/models/sql/compiler.py') diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py index 32657a3e40..73cf2c5f62 100644 --- a/django/db/models/sql/compiler.py +++ b/django/db/models/sql/compiler.py @@ -44,6 +44,13 @@ class SQLCompiler: self.klass_info = None self._meta_ordering = None + def __repr__(self): + return ( + f'<{self.__class__.__qualname__} ' + f'model={self.query.model.__qualname__} ' + f'connection={self.connection!r} using={self.using!r}>' + ) + def setup_query(self): if all(self.query.alias_refcount[a] == 0 for a in self.query.alias_map): self.query.get_initial_alias() -- cgit v1.3