summaryrefslogtreecommitdiff
path: root/django/contrib/postgres/constraints.py
diff options
context:
space:
mode:
authorHannes Ljungberg <hannes.ljungberg@gmail.com>2021-02-19 12:16:24 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-02-19 20:25:11 +0100
commit87acbf063156ebb3fec3d35ef139895335061e0b (patch)
tree16e449178666825bc507d0701220e150aa9f8643 /django/contrib/postgres/constraints.py
parent7c18b22e2fa70aa8dcfadb33beb17933abdf7ee4 (diff)
downloaddjango-87acbf063156ebb3fec3d35ef139895335061e0b.tar.gz
Fixed #32458 -- Made __repr__() for Index and BaseConstraint subclasses more consistent.
Diffstat (limited to 'django/contrib/postgres/constraints.py')
-rw-r--r--django/contrib/postgres/constraints.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/django/contrib/postgres/constraints.py b/django/contrib/postgres/constraints.py
index a844b899b7..32c6bb622e 100644
--- a/django/contrib/postgres/constraints.py
+++ b/django/contrib/postgres/constraints.py
@@ -155,12 +155,13 @@ class ExclusionConstraint(BaseConstraint):
return super().__eq__(other)
def __repr__(self):
- return '<%s: index_type=%s, expressions=%s%s%s%s%s>' % (
+ return '<%s: index_type=%s expressions=%s name=%s%s%s%s%s>' % (
self.__class__.__qualname__,
- self.index_type,
- self.expressions,
- '' if self.condition is None else ', condition=%s' % self.condition,
- '' if self.deferrable is None else ', deferrable=%s' % self.deferrable,
- '' if not self.include else ', include=%s' % repr(self.include),
- '' if not self.opclasses else ', opclasses=%s' % repr(self.opclasses),
+ repr(self.index_type),
+ repr(self.expressions),
+ repr(self.name),
+ '' if self.condition is None else ' condition=%s' % self.condition,
+ '' if self.deferrable is None else ' deferrable=%s' % self.deferrable,
+ '' if not self.include else ' include=%s' % repr(self.include),
+ '' if not self.opclasses else ' opclasses=%s' % repr(self.opclasses),
)