ProjectDjango/DjangoMigrationsListDialog.py

changeset 169
b8f263e05c39
parent 168
c6182aab51e9
child 172
ea7980ded4f3
equal deleted inserted replaced
168:c6182aab51e9 169:b8f263e05c39
37 @param django reference to the Django project object 37 @param django reference to the Django project object
38 @type Project 38 @type Project
39 @param parent reference to the parent widget 39 @param parent reference to the parent widget
40 @type QWidget 40 @type QWidget
41 """ 41 """
42 super(DjangoMigrationsListDialog, self).__init__(parent) 42 super().__init__(parent)
43 self.setupUi(self) 43 self.setupUi(self)
44 44
45 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) 45 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
46 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 46 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
47 47
374 for itm in self.migrationsList.selectedItems(): 374 for itm in self.migrationsList.selectedItems():
375 if itm.parent() is None: 375 if itm.parent() is None:
376 apps.append(itm.text(0)) 376 apps.append(itm.text(0))
377 377
378 if apps: 378 if apps:
379 if self.__django.getDjangoVersion() >= (1, 8, 0): 379 migration, ok = QInputDialog.getText(
380 migration, ok = QInputDialog.getText( 380 self,
381 self, 381 self.tr("Make Migrations"),
382 self.tr("Make Migrations"), 382 self.tr("Enter a name for the migrations (leave empty to"
383 self.tr("Enter a name for the migrations (leave empty to" 383 " use system supplied name):"),
384 " use system supplied name):"), 384 QLineEdit.Normal)
385 QLineEdit.Normal)
386 else:
387 migration = ""
388 ok = True
389 385
390 if ok: 386 if ok:
391 self.__django.makeMigrations(apps, migration, dryRun, empty, 387 self.__django.makeMigrations(apps, migration, dryRun, empty,
392 True) 388 True)
393 389

eric ide

mercurial