mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #23919 -- Stopped inheriting from object to define new style classes.
This commit is contained in:
committed by
Claude Paroz
parent
a556396339
commit
cecc079168
@@ -16,7 +16,7 @@ from django.db.migrations.utils import (
|
||||
from .topological_sort import stable_topological_sort
|
||||
|
||||
|
||||
class MigrationAutodetector(object):
|
||||
class MigrationAutodetector:
|
||||
"""
|
||||
Takes a pair of ProjectStates, and compares them to see what the
|
||||
first would need doing to make it match the second (the second
|
||||
|
||||
@@ -7,7 +7,7 @@ from .recorder import MigrationRecorder
|
||||
from .state import ProjectState
|
||||
|
||||
|
||||
class MigrationExecutor(object):
|
||||
class MigrationExecutor:
|
||||
"""
|
||||
End-to-end migration execution - loads migrations, and runs them
|
||||
up or down to a specified set of targets.
|
||||
|
||||
@@ -18,7 +18,7 @@ RECURSION_DEPTH_WARNING = (
|
||||
|
||||
|
||||
@total_ordering
|
||||
class Node(object):
|
||||
class Node:
|
||||
"""
|
||||
A single node in the migration graph. Contains direct links to adjacent
|
||||
nodes in either direction.
|
||||
@@ -100,7 +100,7 @@ class DummyNode(Node):
|
||||
raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
|
||||
|
||||
|
||||
class MigrationGraph(object):
|
||||
class MigrationGraph:
|
||||
"""
|
||||
Represents the digraph of all migrations in a project.
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ from .exceptions import (
|
||||
MIGRATIONS_MODULE_NAME = 'migrations'
|
||||
|
||||
|
||||
class MigrationLoader(object):
|
||||
class MigrationLoader:
|
||||
"""
|
||||
Loads migration files from disk, and their status from the database.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from django.db.transaction import atomic
|
||||
from .exceptions import IrreversibleError
|
||||
|
||||
|
||||
class Migration(object):
|
||||
class Migration:
|
||||
"""
|
||||
The base class for all migrations.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from django.db import router
|
||||
|
||||
|
||||
class Operation(object):
|
||||
class Operation:
|
||||
"""
|
||||
Base class for migration operations.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class MigrationOptimizer(object):
|
||||
class MigrationOptimizer:
|
||||
"""
|
||||
Powers the optimization process, where you provide a list of Operations
|
||||
and you are returned a list of equal or shorter length - operations
|
||||
|
||||
@@ -9,7 +9,7 @@ from django.utils import datetime_safe, timezone
|
||||
from .loader import MigrationLoader
|
||||
|
||||
|
||||
class MigrationQuestioner(object):
|
||||
class MigrationQuestioner:
|
||||
"""
|
||||
Gives the autodetector responses to questions it might have.
|
||||
This base class has a built-in noninteractive mode, but the
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.utils.timezone import now
|
||||
from .exceptions import MigrationSchemaMissing
|
||||
|
||||
|
||||
class MigrationRecorder(object):
|
||||
class MigrationRecorder:
|
||||
"""
|
||||
Deals with storing migration records in the database.
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ except ImportError:
|
||||
enum = None
|
||||
|
||||
|
||||
class BaseSerializer(object):
|
||||
class BaseSerializer:
|
||||
def __init__(self, value):
|
||||
self.value = value
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ def get_related_models_recursive(model):
|
||||
return seen - {(model._meta.app_label, model._meta.model_name)}
|
||||
|
||||
|
||||
class ProjectState(object):
|
||||
class ProjectState:
|
||||
"""
|
||||
Represents the entire project's overall state.
|
||||
This is the item that is passed around - we do it here rather than at the
|
||||
@@ -356,7 +356,7 @@ class StateApps(Apps):
|
||||
pass
|
||||
|
||||
|
||||
class ModelState(object):
|
||||
class ModelState:
|
||||
"""
|
||||
Represents a Django Model. We don't use the actual Model class
|
||||
as it's not designed to have its options changed - instead, we
|
||||
|
||||
@@ -4,7 +4,7 @@ import re
|
||||
COMPILED_REGEX_TYPE = type(re.compile(''))
|
||||
|
||||
|
||||
class RegexObject(object):
|
||||
class RegexObject:
|
||||
def __init__(self, obj):
|
||||
self.pattern = obj.pattern
|
||||
self.flags = obj.flags
|
||||
|
||||
@@ -34,7 +34,7 @@ class SettingsReference(str):
|
||||
self.setting_name = setting_name
|
||||
|
||||
|
||||
class OperationWriter(object):
|
||||
class OperationWriter:
|
||||
def __init__(self, operation, indentation=2):
|
||||
self.operation = operation
|
||||
self.buff = []
|
||||
@@ -134,7 +134,7 @@ class OperationWriter(object):
|
||||
return '\n'.join(self.buff)
|
||||
|
||||
|
||||
class MigrationWriter(object):
|
||||
class MigrationWriter:
|
||||
"""
|
||||
Takes a Migration instance and is able to produce the contents
|
||||
of the migration file from it.
|
||||
|
||||
Reference in New Issue
Block a user