Index: src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py	(revision 3b3b40bf9d5056d902b19728c621dd2a4661d65f)
+++ src/sas/qtgui/Perspectives/Fitting/ConstraintWidget.py	(revision 8b480d271418f2fa35e0597730c97807da3140d6)
@@ -171,5 +171,6 @@
                     # No such tab!
                     return
-                sim_fitter_list, fitter_id = tab_object.prepareFitters(fitter=sim_fitter_list[0], fit_id=fitter_id)
+                sim_fitter_list, fitter_id = \
+                    tab_object.prepareFitters(fitter=sim_fitter_list[0], fit_id=fitter_id)
                 page_ids.append([tab_object.page_id])
         except ValueError:
Index: src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/FittingWidget.py	(revision 3b3b40bf9d5056d902b19728c621dd2a4661d65f)
+++ src/sas/qtgui/Perspectives/Fitting/FittingWidget.py	(revision 8b480d271418f2fa35e0597730c97807da3140d6)
@@ -424,5 +424,6 @@
             self.onSelectModel()
 
-    def customModels(self):
+    @classmethod
+    def customModels(cls):
         """ Reads in file names in the custom plugin directory """
         return ModelUtilities._find_models()
@@ -1051,5 +1052,5 @@
             self._model_model.clear()
             return
-            
+
         # Safely clear and enable the model combo
         self.cbModel.blockSignals(True)
@@ -1357,5 +1358,9 @@
         smearing, accuracy, smearing_min, smearing_max = self.smearing_widget.state()
 
-        constraints = self.getConstraintsForFitting()
+        # Get the constraints.
+        constraints = self.getComplexConstraintsForModel()
+        if fitter is None:
+            # For single fits - check for inter-model constraints
+            constraints = self.getConstraintsForFitting()
 
         smearer = None
Index: src/sas/qtgui/Utilities/GridPanel.py
===================================================================
--- src/sas/qtgui/Utilities/GridPanel.py	(revision 3b3b40bf9d5056d902b19728c621dd2a4661d65f)
+++ src/sas/qtgui/Utilities/GridPanel.py	(revision 8b480d271418f2fa35e0597730c97807da3140d6)
@@ -4,5 +4,5 @@
 import webbrowser
 
-from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5 import QtCore, QtWidgets
 
 import sas.qtgui.Utilities.GuiUtils as GuiUtils
@@ -91,5 +91,6 @@
         return
 
-    def onHelp(self):
+    @classmethod
+    def onHelp(cls):
         """
         Open a local url in the default browser
@@ -119,5 +120,6 @@
                 return
 
-    def dataFromTable(self, table):
+    @classmethod
+    def dataFromTable(cls, table):
         """
         Creates a dictionary {<parameter>:[list of values]} from the parameter table
@@ -125,7 +127,5 @@
         assert(isinstance(table, QtWidgets.QTableWidget))
         params = {}
-        #return {"sld_solvent":[1.2, 2.0, 0.0], "scale":[1.0, 2.0, 3.0]}
         for column in range(table.columnCount()):
-            #pass
             value = [table.item(row, column).data(0) for row in range(table.rowCount())]
             key = table.horizontalHeaderItem(column).data(0)
@@ -144,5 +144,5 @@
             t = time.localtime(time.time())
             time_str = time.strftime("%b %d %H:%M of %Y", t)
-            details = "File Generated by SasView " 
+            details = "File Generated by SasView "
             details += "on %s.\n" % time_str
             self.writeBatchToFile(data=data, tmpfile=tmpfile, details=details)
@@ -247,5 +247,6 @@
         self.tblParams.resizeColumnsToContents()
 
-    def writeBatchToFile(self, data, tmpfile, details=""):
+    @classmethod
+    def writeBatchToFile(cls, data, tmpfile, details=""):
         """
         Helper to write result from batch into cvs file
Index: src/sas/qtgui/Utilities/ModelEditor.py
===================================================================
--- src/sas/qtgui/Utilities/ModelEditor.py	(revision 3b3b40bf9d5056d902b19728c621dd2a4661d65f)
+++ src/sas/qtgui/Utilities/ModelEditor.py	(revision 8b480d271418f2fa35e0597730c97807da3140d6)
@@ -1,13 +1,5 @@
-# global
-import sys
-import os
-import types
-import webbrowser
-
 from PyQt5 import QtCore
-from PyQt5 import QtGui
 from PyQt5 import QtWidgets
 
-import sas.qtgui.Utilities.GuiUtils as GuiUtils
 from sas.qtgui.Utilities.PythonSyntax import PythonHighlighter
 
@@ -49,5 +41,4 @@
         if self.txtEditor.toPlainText() != "":
             self.modelModified.emit()
-        pass
 
     def getModel(self):
Index: src/sas/qtgui/Utilities/PluginDefinition.py
===================================================================
--- src/sas/qtgui/Utilities/PluginDefinition.py	(revision 3b3b40bf9d5056d902b19728c621dd2a4661d65f)
+++ src/sas/qtgui/Utilities/PluginDefinition.py	(revision 8b480d271418f2fa35e0597730c97807da3140d6)
@@ -1,7 +1,2 @@
-# global
-import sys
-import os
-import logging 
-
 from PyQt5 import QtCore
 from PyQt5 import QtGui
@@ -69,5 +64,5 @@
         txt_validator = QtGui.QRegExpValidator(rx)
         self.txtName.setValidator(txt_validator)
-        self.highlight = PythonHighlighter(self.txtFunction.document())        
+        self.highlight = PythonHighlighter(self.txtFunction.document())
 
     def initializeModel(self):
Index: src/sas/qtgui/Utilities/PluginManager.py
===================================================================
--- src/sas/qtgui/Utilities/PluginManager.py	(revision 3b3b40bf9d5056d902b19728c621dd2a4661d65f)
+++ src/sas/qtgui/Utilities/PluginManager.py	(revision 8b480d271418f2fa35e0597730c97807da3140d6)
@@ -1,10 +1,6 @@
 # global
-import sys
 import os
-import logging 
 from shutil import copyfile
 
-from PyQt5 import QtCore
-from PyQt5 import QtGui
 from PyQt5 import QtWidgets
 
Index: src/sas/qtgui/Utilities/PythonSyntax.py
===================================================================
--- src/sas/qtgui/Utilities/PythonSyntax.py	(revision 3b3b40bf9d5056d902b19728c621dd2a4661d65f)
+++ src/sas/qtgui/Utilities/PythonSyntax.py	(revision 8b480d271418f2fa35e0597730c97807da3140d6)
@@ -1,4 +1,2 @@
-import sys
-
 from PyQt5.QtCore import QRegExp
 from PyQt5.QtGui import QColor, QTextCharFormat, QFont, QSyntaxHighlighter
@@ -175,6 +173,4 @@
 
 if __name__ == '__main__':
-    import sys
-
     from PyQt5 import QtWidgets
 
Index: src/sas/qtgui/Utilities/TabbedModelEditor.py
===================================================================
--- src/sas/qtgui/Utilities/TabbedModelEditor.py	(revision 3b3b40bf9d5056d902b19728c621dd2a4661d65f)
+++ src/sas/qtgui/Utilities/TabbedModelEditor.py	(revision 8b480d271418f2fa35e0597730c97807da3140d6)
@@ -2,12 +2,8 @@
 import sys
 import os
-import types
 import datetime
 import numpy as np
-import webbrowser
 import logging
 
-from PyQt5 import QtCore
-from PyQt5 import QtGui
 from PyQt5 import QtWidgets
 
@@ -17,5 +13,4 @@
 from sas.qtgui.Utilities.PluginDefinition import PluginDefinition
 from sas.qtgui.Utilities.ModelEditor import ModelEditor
-import sas.qtgui.Utilities.GuiUtils as GuiUtils
 
 class TabbedModelEditor(QtWidgets.QDialog, Ui_TabbedModelEditor):
@@ -314,5 +309,6 @@
         return self.tabWidget.currentWidget().getModel()
 
-    def writeFile(self, fname, model_str=""):
+    @classmethod
+    def writeFile(cls, fname, model_str=""):
         """
         Write model content to file "fname"
@@ -342,11 +338,13 @@
         model_text += 'parameters = [ \n'
         model_text += '#   ["name", "units", default, [lower, upper], "type", "description"],\n'
-        for pname, pvalue, desc in self.getParamHelper(param_str):
-            param_names.append(pname)
-            model_text += "    ['%s', '', %s, [-inf, inf], '', '%s'],\n" % (pname, pvalue, desc)
-        for pname, pvalue, desc in self.getParamHelper(pd_param_str):
-            param_names.append(pname)
-            pd_params.append(pname)
-            model_text += "    ['%s', '', %s, [-inf, inf], 'volume', '%s'],\n" % (pname, pvalue, desc)
+        if param_str:
+            for pname, pvalue, desc in self.getParamHelper(param_str):
+                param_names.append(pname)
+                model_text += "    ['%s', '', %s, [-inf, inf], '', '%s'],\n" % (pname, pvalue, desc)
+        if pd_param_str:
+            for pname, pvalue, desc in self.getParamHelper(pd_param_str):
+                param_names.append(pname)
+                pd_params.append(pname)
+                model_text += "    ['%s', '', %s, [-inf, inf], 'volume', '%s'],\n" % (pname, pvalue, desc)
         model_text += '    ]\n'
 
@@ -381,5 +379,6 @@
         return model_text
 
-    def checkModel(self, path):
+    @classmethod
+    def checkModel(cls, path):
         """
         Check that the model save in file 'path' can run.
@@ -390,7 +389,7 @@
         model = Model()
         q =  np.array([0.01, 0.1])
-        Iq = model.evalDistribution(q)
+        _ = model.evalDistribution(q)
         qx, qy =  np.array([0.01, 0.01]), np.array([0.1, 0.1])
-        Iqxy = model.evalDistribution([qx, qy])
+        _ = model.evalDistribution([qx, qy])
 
         # check the model's unit tests run
@@ -400,5 +399,6 @@
         return result
 
-    def getParamHelper(self, param_str):
+    @classmethod
+    def getParamHelper(cls, param_str):
         """
         yield a sequence of name, value pairs for the parameters in param_str
@@ -414,6 +414,7 @@
                 if name:
                     yield [v.strip() for v in (name, value, desc)]
-        
-    def strFromParamDict(self, param_dict):
+
+    @classmethod
+    def strFromParamDict(cls, param_dict):
         """
         Creates string from parameter dictionary
@@ -423,5 +424,5 @@
         """
         param_str = ""
-        for row, params in param_dict.items():
+        for _, params in param_dict.items():
             if not params[0]: continue
             value = 1
@@ -500,8 +501,7 @@
 
 if __name__ == '__main__':
-    import sys
     app = QtWidgets.QApplication(sys.argv)
     sheet = TabbedModelEditor()
     sheet.show()
-    sys.exit(app.exec_())
+    app.exec_()
     
