ProjectDjango/DjangoMakeMigrationsDialog.py

changeset 74
f33822c3eb47
child 75
0165ce437462
equal deleted inserted replaced
73:8a4ccc4f1359 74:f33822c3eb47
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2016 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a dialog to enter the data needed to make migrations.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt5.QtWidgets import QDialog
13
14 from .Ui_DjangoMakeMigrationsDialog import Ui_DjangoMakeMigrationsDialog
15
16
17 class DjangoMakeMigrationsDialog(QDialog, Ui_DjangoMakeMigrationsDialog):
18 """
19 Class implementing a dialog to enter the data needed to make migrations.
20 """
21 def __init__(self, recentApps, parent=None):
22 """
23 Constructor
24
25 @param parent reference to the parent widget
26 @type QWidget
27 """
28 super(DjangoMakeMigrationsDialog, self).__init__(parent)
29 self.setupUi(self)
30
31 self.applicationsComboBox.addItems(recentApps)
32
33 def getData(self):
34 """
35 Public method to get the data for the migration.
36
37 @return tuple containing the application names, a migration name
38 and the dry-run flag
39 @rtype tuple of two str and a bool
40 """
41 return (
42 self.applicationsComboBox.currentText(),
43 self.nameEdit.text(),
44 self.dryrunCheckBox.isChecked(),
45 )

eric ide

mercurial