Fixed typo in autodetector method name.

This commit is contained in:
Akshesh 2016-07-16 20:11:31 +05:30 committed by Tim Graham
parent 599393172b
commit bdba0fc195
1 changed files with 4 additions and 4 deletions

View File

@ -562,7 +562,7 @@ class MigrationAutodetector(object):
# Generate operations for each related field # Generate operations for each related field
for name, field in sorted(related_fields.items()): for name, field in sorted(related_fields.items()):
dependencies = self._get_dependecies_for_foreign_key(field) dependencies = self._get_dependencies_for_foreign_key(field)
# Depend on our own model being created # Depend on our own model being created
dependencies.append((app_label, model_name, None, True)) dependencies.append((app_label, model_name, None, True))
# Make operation # Make operation
@ -813,7 +813,7 @@ class MigrationAutodetector(object):
# Fields that are foreignkeys/m2ms depend on stuff # Fields that are foreignkeys/m2ms depend on stuff
dependencies = [] dependencies = []
if field.remote_field and field.remote_field.model: if field.remote_field and field.remote_field.model:
dependencies.extend(self._get_dependecies_for_foreign_key(field)) dependencies.extend(self._get_dependencies_for_foreign_key(field))
# You can't just add NOT NULL fields with no default or fields # You can't just add NOT NULL fields with no default or fields
# which don't allow empty strings as default. # which don't allow empty strings as default.
preserve_default = True preserve_default = True
@ -919,7 +919,7 @@ class MigrationAutodetector(object):
self._generate_removed_field(app_label, model_name, field_name) self._generate_removed_field(app_label, model_name, field_name)
self._generate_added_field(app_label, model_name, field_name) self._generate_added_field(app_label, model_name, field_name)
def _get_dependecies_for_foreign_key(self, field): def _get_dependencies_for_foreign_key(self, field):
# Account for FKs to swappable models # Account for FKs to swappable models
swappable_setting = getattr(field, 'swappable_setting', None) swappable_setting = getattr(field, 'swappable_setting', None)
if swappable_setting is not None: if swappable_setting is not None:
@ -966,7 +966,7 @@ class MigrationAutodetector(object):
for field_name in foo_togethers: for field_name in foo_togethers:
field = self.new_apps.get_model(app_label, model_name)._meta.get_field(field_name) field = self.new_apps.get_model(app_label, model_name)._meta.get_field(field_name)
if field.remote_field and field.remote_field.model: if field.remote_field and field.remote_field.model:
dependencies.extend(self._get_dependecies_for_foreign_key(field)) dependencies.extend(self._get_dependencies_for_foreign_key(field))
self.add_operation( self.add_operation(
app_label, app_label,