From 615cb5951ed6e6bfedceedfe8405c734861dc806 Mon Sep 17 00:00:00 2001 From: Bendeguz Csirmaz Date: Mon, 26 Aug 2024 17:00:42 +0800 Subject: [PATCH] Fixed #373 - Add ColPairs.__repr__. --- django/db/models/expressions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py index 154e684ff0471..702fba608d1dc 100644 --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -1340,6 +1340,10 @@ def __len__(self): def __iter__(self): return iter(self.get_cols()) + def __repr__(self): + cols = ", ".join(repr(col) for col in self.get_cols()) + return "{}({})".format(self.__class__.__name__, cols) + def get_cols(self): return [ Col(self.alias, target, source)