summaryrefslogtreecommitdiff
path: root/django/db/models/sql
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/models/sql')
-rw-r--r--django/db/models/sql/compiler.py7
-rw-r--r--django/db/models/sql/query.py6
2 files changed, 13 insertions, 0 deletions
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()
diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py
index 2c5f11cbbf..faca57da56 100644
--- a/django/db/models/sql/query.py
+++ b/django/db/models/sql/query.py
@@ -2393,6 +2393,12 @@ class JoinPromoter:
# inner and/or outer joins.
self.votes = Counter()
+ def __repr__(self):
+ return (
+ f'{self.__class__.__qualname__}(connector={self.connector!r}, '
+ f'num_children={self.num_children!r}, negated={self.negated!r})'
+ )
+
def add_votes(self, votes):
"""
Add single vote per item to self.votes. Parameter can be any