diff -r 8413c2429808 -r 64339135bd61 ProjectDjango/DjangoDumpdataDataDialog.py --- a/ProjectDjango/DjangoDumpdataDataDialog.py Fri Dec 31 13:17:55 2021 +0100 +++ b/ProjectDjango/DjangoDumpdataDataDialog.py Wed Sep 21 16:42:20 2022 +0200 @@ -18,10 +18,11 @@ """ Class implementing a dialog to enter the data for the 'dumpdata' command. """ + def __init__(self, project, parent=None): """ Constructor - + @param project reference to the Django project object @type Project @param parent reference to the parent widget @@ -29,27 +30,28 @@ """ super().__init__(parent) self.setupUi(self) - + self.__project = project - + apps = self.__project.getRecentApplications() self.applicationsCombo.addItems(apps) self.excludeCombo.addItems(apps) self.excludeCombo.setEditText("") - + self.formatCombo.addItem(self.tr("JSON"), "json") self.formatCombo.addItem(self.tr("XML"), "xml") with contextlib.suppress(ImportError): - import yaml # __IGNORE_WARNING__ + import yaml # __IGNORE_WARNING__ + self.formatCombo.addItem(self.tr("YAML"), "yaml") - + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + def getData(self): """ Public method to get the data entered into the dialog. - + @return tuple giving the list of applications to work on, the list of applications to exclude, the dump format and the indentation level @rtype tuple of (list of str, list of str, str, int) @@ -60,10 +62,10 @@ appls = applStr.split() else: appls = [] - + exclStr = self.excludeCombo.currentText() excl = exclStr.split() if exclStr else [] - + dumpFormat = self.formatCombo.itemData(self.formatCombo.currentIndex()) - + return appls, excl, dumpFormat, self.indentationSpinBox.value()