diff -r 230363929c49 -r f8e92eaaba6e ProjectDjango/DjangoMigrationSelectionDialog.py --- a/ProjectDjango/DjangoMigrationSelectionDialog.py Tue Dec 20 11:20:24 2016 +0100 +++ b/ProjectDjango/DjangoMigrationSelectionDialog.py Tue Dec 20 12:26:33 2016 +0100 @@ -24,12 +24,15 @@ """ Class implementing a dialog to select an application and migration. """ - def __init__(self, migrations, parent=None): + def __init__(self, migrations, migrationRequired=False, parent=None): """ Constructor @param migrations dictionary containing the available migrations @type dict + @param migrationRequired flag indicating that a migration must be + selected + @type bool @param parent reference to the parent widget @type QWidget """ @@ -39,6 +42,8 @@ self.__appliedIcon = QIcon(os.path.join( os.path.dirname(__file__), "icons", "applied.png")) + self.__migrationRequired = migrationRequired + self.__migrations = migrations self.applicationComboBox.addItems(sorted(self.__migrations.keys())) self.on_applicationComboBox_activated( @@ -56,7 +61,8 @@ @type str """ self.migrationsComboBox.clear() - self.migrationsComboBox.addItem("") + if not self.__migrationRequired: + self.migrationsComboBox.addItem("") for applied, migration in self.__migrations[app]: if applied: self.migrationsComboBox.addItem(self.__appliedIcon, migration)