1
0
mirror of https://github.com/django/django.git synced 2025-10-28 16:16:12 +00:00

Initial version of MigrationOptimizer and tests

This commit is contained in:
Andrew Godwin
2013-10-02 17:33:41 +01:00
parent 75bb6ba966
commit a80d9ab0fe
5 changed files with 237 additions and 0 deletions

View File

@@ -63,3 +63,16 @@ class Operation(object):
Outputs a brief summary of what the action does.
"""
return "%s: %s" % (self.__class__.__name__, self._constructor_args)
def __repr__(self):
return "<%s %s%s>" % (
self.__class__.__name__,
", ".join(map(repr, self._constructor_args[0])),
",".join(" %s=%r" % x for x in self._constructor_args[1].items()),
)
def __eq__(self, other):
return (self.__class__ == other.__class__) and (self.deconstruct() == other.deconstruct())
def __ne__(self, other):
return not (self == other)