summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
authorLoic Bistuer <loic.bistuer@gmail.com>2014-07-06 13:57:23 +0700
committerLoic Bistuer <loic.bistuer@gmail.com>2014-07-06 14:56:18 +0700
commit2572c07cc64177e985b453d0f0b819e85fe080cc (patch)
tree4686f77800ab25134097e0c3ad879ed3fa69c4e2 /django/db
parent32fefc6f70c529ee5f13b2d82a26333fb7a4ed14 (diff)
Fixed #22906 -- Added a more helpful repr to migrations' ModelState.
Thanks Collin Anderson for the report and original patch.
Diffstat (limited to 'django/db')
-rw-r--r--django/db/migrations/state.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/migrations/state.py b/django/db/migrations/state.py
index 69bfbb2ab2..d27e5013b7 100644
--- a/django/db/migrations/state.py
+++ b/django/db/migrations/state.py
@@ -300,6 +300,9 @@ class ModelState(object):
return field
raise ValueError("No field called %s on model %s" % (name, self.name))
+ def __repr__(self):
+ return "<ModelState: '%s.%s'>" % (self.app_label, self.name)
+
def __eq__(self, other):
return (
(self.app_label == other.app_label) and