暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

makemigrations_interactive_rename.patch 1017B

123456789101112131415161718192021222324
  1. --- orig/django/core/management/commands/makemigrations.py 2015-09-16 11:52:59.456895569 +0200
  2. +++ new/django/core/management/commands/makemigrations.py 2015-09-16 11:51:34.344896348 +0200
  3. @@ -84,11 +84,20 @@ class Command(BaseCommand):
  4. if self.merge and conflicts:
  5. return self.handle_merge(loader, conflicts)
  6. + questionner_kwargs = {
  7. + 'specified_apps': app_labels,
  8. + 'dry_run': self.dry_run
  9. + }
  10. + if self.interactive:
  11. + questionner = InteractiveMigrationQuestioner(**questionner_kwargs)
  12. + else:
  13. + questionner = MigrationQuestioner(**questionner_kwargs)
  14. +
  15. # Set up autodetector
  16. autodetector = MigrationAutodetector(
  17. loader.project_state(),
  18. ProjectState.from_apps(apps),
  19. - InteractiveMigrationQuestioner(specified_apps=app_labels, dry_run=self.dry_run),
  20. + questionner
  21. )
  22. # If they want to make an empty migration, make one for each app