@@ -60,9 +60,9 @@ def references_field(self, model_name, name, app_label=None):
60
60
return True
61
61
return False
62
62
63
- def reduce (self , operation , in_between , app_label = None ):
63
+ def reduce (self , operation , app_label = None ):
64
64
return (
65
- super ().reduce (operation , in_between , app_label = app_label ) or
65
+ super ().reduce (operation , app_label = app_label ) or
66
66
not operation .references_field (self .model_name , self .name , app_label )
67
67
)
68
68
@@ -122,7 +122,7 @@ def database_backwards(self, app_label, schema_editor, from_state, to_state):
122
122
def describe (self ):
123
123
return "Add field %s to %s" % (self .name , self .model_name )
124
124
125
- def reduce (self , operation , in_between , app_label = None ):
125
+ def reduce (self , operation , app_label = None ):
126
126
if isinstance (operation , FieldOperation ) and self .is_same_field_operation (operation ):
127
127
if isinstance (operation , AlterField ):
128
128
return [
@@ -142,7 +142,7 @@ def reduce(self, operation, in_between, app_label=None):
142
142
field = self .field ,
143
143
),
144
144
]
145
- return super ().reduce (operation , in_between , app_label = app_label )
145
+ return super ().reduce (operation , app_label = app_label )
146
146
147
147
148
148
class RemoveField (FieldOperation ):
@@ -186,11 +186,11 @@ def database_backwards(self, app_label, schema_editor, from_state, to_state):
186
186
def describe (self ):
187
187
return "Remove field %s from %s" % (self .name , self .model_name )
188
188
189
- def reduce (self , operation , in_between , app_label = None ):
189
+ def reduce (self , operation , app_label = None ):
190
190
from .models import DeleteModel
191
191
if isinstance (operation , DeleteModel ) and operation .name_lower == self .model_name_lower :
192
192
return [operation ]
193
- return super ().reduce (operation , in_between , app_label = app_label )
193
+ return super ().reduce (operation , app_label = app_label )
194
194
195
195
196
196
class AlterField (FieldOperation ):
@@ -256,7 +256,7 @@ def database_backwards(self, app_label, schema_editor, from_state, to_state):
256
256
def describe (self ):
257
257
return "Alter field %s on %s" % (self .name , self .model_name )
258
258
259
- def reduce (self , operation , in_between , app_label = None ):
259
+ def reduce (self , operation , app_label = None ):
260
260
if isinstance (operation , RemoveField ) and self .is_same_field_operation (operation ):
261
261
return [operation ]
262
262
elif isinstance (operation , RenameField ) and self .is_same_field_operation (operation ):
@@ -268,7 +268,7 @@ def reduce(self, operation, in_between, app_label=None):
268
268
field = self .field ,
269
269
),
270
270
]
271
- return super ().reduce (operation , in_between , app_label = app_label )
271
+ return super ().reduce (operation , app_label = app_label )
272
272
273
273
274
274
class RenameField (FieldOperation ):
@@ -383,7 +383,7 @@ def references_field(self, model_name, name, app_label=None):
383
383
name .lower () == self .new_name_lower
384
384
)
385
385
386
- def reduce (self , operation , in_between , app_label = None ):
386
+ def reduce (self , operation , app_label = None ):
387
387
if (isinstance (operation , RenameField ) and
388
388
self .is_same_model_operation (operation ) and
389
389
self .new_name_lower == operation .old_name_lower ):
@@ -397,6 +397,6 @@ def reduce(self, operation, in_between, app_label=None):
397
397
# Skip `FieldOperation.reduce` as we want to run `references_field`
398
398
# against self.new_name.
399
399
return (
400
- super (FieldOperation , self ).reduce (operation , in_between , app_label = app_label ) or
400
+ super (FieldOperation , self ).reduce (operation , app_label = app_label ) or
401
401
not operation .references_field (self .model_name , self .new_name , app_label )
402
402
)
0 commit comments