From 451b585c2f76507b1be9d855a41cf2bb5aad6026 Mon Sep 17 00:00:00 2001 From: chillaranand Date: Wed, 14 Jun 2017 18:11:24 +0530 Subject: [PATCH] Refs #27914 -- Used __qualname__ in model operations' deconstruct(). --- django/db/migrations/operations/models.py | 22 +++++++++++----------- django/db/migrations/operations/special.py | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/django/db/migrations/operations/models.py b/django/db/migrations/operations/models.py index 7daf8a7eec..9754181e84 100644 --- a/django/db/migrations/operations/models.py +++ b/django/db/migrations/operations/models.py @@ -71,7 +71,7 @@ class CreateModel(ModelOperation): if self.managers and self.managers != [('objects', models.Manager())]: kwargs['managers'] = self.managers return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs ) @@ -232,7 +232,7 @@ class DeleteModel(ModelOperation): 'name': self.name, } return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs ) @@ -276,7 +276,7 @@ class RenameModel(ModelOperation): 'new_name': self.new_name, } return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs ) @@ -429,7 +429,7 @@ class AlterModelTable(ModelOperation): 'table': self.table, } return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs ) @@ -505,7 +505,7 @@ class AlterUniqueTogether(FieldRelatedOptionOperation): 'unique_together': self.unique_together, } return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs ) @@ -559,7 +559,7 @@ class AlterIndexTogether(FieldRelatedOptionOperation): 'index_together': self.index_together, } return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs ) @@ -608,7 +608,7 @@ class AlterOrderWithRespectTo(FieldRelatedOptionOperation): 'order_with_respect_to': self.order_with_respect_to, } return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs ) @@ -683,7 +683,7 @@ class AlterModelOptions(ModelOptionOperation): 'options': self.options, } return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs ) @@ -718,7 +718,7 @@ class AlterModelManagers(ModelOptionOperation): def deconstruct(self): return ( - self.__class__.__name__, + self.__class__.__qualname__, [self.name, self.managers], {} ) @@ -781,7 +781,7 @@ class AddIndex(IndexOperation): 'index': self.index, } return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs, ) @@ -827,7 +827,7 @@ class RemoveIndex(IndexOperation): 'name': self.name, } return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs, ) diff --git a/django/db/migrations/operations/special.py b/django/db/migrations/operations/special.py index 89fd9baa64..5a8510ec02 100644 --- a/django/db/migrations/operations/special.py +++ b/django/db/migrations/operations/special.py @@ -24,7 +24,7 @@ class SeparateDatabaseAndState(Operation): if self.state_operations: kwargs['state_operations'] = self.state_operations return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs ) @@ -87,7 +87,7 @@ class RunSQL(Operation): if self.hints: kwargs['hints'] = self.hints return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs ) @@ -164,7 +164,7 @@ class RunPython(Operation): if self.hints: kwargs['hints'] = self.hints return ( - self.__class__.__name__, + self.__class__.__qualname__, [], kwargs )