diff options
author | Patryk Zawadzki <patrys@room-303.com> | 2014-11-15 20:25:43 +0100 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2014-11-20 12:49:49 -0500 |
commit | 21e21c7bc2b8bf7ae127e2aa75048a60d05a6e0f (patch) | |
tree | 4dcef326223e6f517610298794422f73da30478c /tests/custom_migration_operations | |
parent | 53908c1f934b32e83e9fa34c14910b1837f7f610 (diff) | |
download | django-21e21c7bc2b8bf7ae127e2aa75048a60d05a6e0f.tar.gz |
Fixed #23844 -- Used topological sort for migration operation dependency resolution.
This removes the concept of equality between operations to guarantee
compatilibity with Python 3.
Python 3 requires equality to result in identical object hashes. It's
impossible to implement a unique hash that preserves equality as
operations such as field creation depend on being able to accept
arbitrary dicts that cannot be hashed reliably.
Thanks Klaas van Schelven for the original patch in
13d613f80011852404198dfafd1f09c0c0ea42e6.
Diffstat (limited to 'tests/custom_migration_operations')
-rw-r--r-- | tests/custom_migration_operations/more_operations.py | 7 | ||||
-rw-r--r-- | tests/custom_migration_operations/operations.py | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/custom_migration_operations/more_operations.py b/tests/custom_migration_operations/more_operations.py index 6fe3d1cf93..30cf246ceb 100644 --- a/tests/custom_migration_operations/more_operations.py +++ b/tests/custom_migration_operations/more_operations.py @@ -5,6 +5,13 @@ class TestOperation(Operation): def __init__(self): pass + def deconstruct(self): + return ( + self.__class__.__name__, + [], + {} + ) + @property def reversible(self): return True diff --git a/tests/custom_migration_operations/operations.py b/tests/custom_migration_operations/operations.py index fc084f8412..3a4127d753 100644 --- a/tests/custom_migration_operations/operations.py +++ b/tests/custom_migration_operations/operations.py @@ -5,6 +5,13 @@ class TestOperation(Operation): def __init__(self): pass + def deconstruct(self): + return ( + self.__class__.__name__, + [], + {} + ) + @property def reversible(self): return True |