Index: calculatorview/src/sans/perspectives/calculator/model_editor.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/model_editor.py	(revision 41a8cb3c3ae33f76bb9b7135a02ad7b41d487750)
+++ calculatorview/src/sans/perspectives/calculator/model_editor.py	(revision 316e23141b5dbc6d16b566d2c0d4f1093176139c)
@@ -324,6 +324,6 @@
             elif line.count("self.description = '%s'"):
                 out_f.write(line % description + "\n")
-            elif line.count("self.name = '%s'"):
-                out_f.write(line % name + "\n")
+            #elif line.count("self.name = '%s'"):
+            #    out_f.write(line % name + "\n")
             else:
                 out_f.write(line + "\n")
@@ -690,6 +690,6 @@
                 if has_scipy:
                     out_f.write("import scipy" + "\n")
-            elif line.count("name = "):
-                out_f.write(line % self.name + "\n")
+            #elif line.count("name = "):
+            #    out_f.write(line % self.name + "\n")
             elif line:
                 out_f.write(line + "\n")
@@ -777,10 +777,14 @@
 from sans.models.pluginmodel import Model1DPlugin
 from math import *
+import os
+import sys
 import numpy
 #import scipy?
 class Model(Model1DPlugin):
-    name = "%s"                             
+    name = ""                             
     def __init__(self):
-        Model1DPlugin.__init__(self, name=self.name)                                                     
+        Model1DPlugin.__init__(self, name=self.name)  
+        #set name same as file name 
+        self.name = self.get_fname()                                                   
         #self.params here
         self.description = "%s"
@@ -827,4 +831,9 @@
 """
 TEST_TEMPLATE = """
+    def get_fname(self):
+        path = sys._getframe().f_code.co_filename
+        basename  = os.path.basename(path)
+        name, _ = os.path.splitext(basename)
+        return name
 ######################################################################
 ## THIS IS FOR TEST. DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!       
@@ -854,4 +863,6 @@
 #P2_model: 
 from sans.models.%s import %s as P2
+import os
+import sys
 
 class Model(Model1DPlugin):
@@ -863,5 +874,5 @@
         ## Setting  model name model description
         self.description = '%s'
-        self.name = '%s'
+        self.name = self.get_fname()
         if self.name.rstrip().lstrip() == '':
             self.name = self._get_name(p_model1.name, p_model2.name)
@@ -1118,5 +1129,11 @@
 ( p_model1.name, p_model2.name )
         self.description += description
-        
+          
+    def get_fname(self):
+        path = sys._getframe().f_code.co_filename
+        basename  = os.path.basename(path)
+        name, _ = os.path.splitext(basename)
+        return name     
+           
 if __name__ == "__main__": 
     m1= Model() 
Index: fittingview/src/sans/perspectives/fitting/plugin_models/polynominal5.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/plugin_models/polynominal5.py	(revision 19e614a88b2cede7e0b229c9b1a8813b1d5a6490)
+++ fittingview/src/sans/perspectives/fitting/plugin_models/polynominal5.py	(revision 316e23141b5dbc6d16b566d2c0d4f1093176139c)
@@ -20,5 +20,6 @@
 import math                    ##DO NOT CHANGE THIS LINE!!!
 import numpy                   ##DO NOT CHANGE THIS LINE!!!
-
+import os
+import sys
 ## <-----  SIGN DEFINES WHERE YOU CAN MODIFY THE CODE
 
@@ -30,7 +31,5 @@
     ##EXAMPLE: Class that evaluates a polynomial model. 
     """
-    ## YOU CAN MODIFY THE LINE BELLOW. CHANGE ONLY WORDS BETWEEN " " 
-    ## TO RENAME YOUR MODEL: THIS NAME IS WHAT YOU SEE ON GUI.
-    name = "polynomial5"        ## <----- FILE NAME (NAME OF THE MODEL)   
+    name = ""  
                                 
     def __init__(self):      ##DO NOT CHANGE THIS LINE!!!
@@ -48,4 +47,6 @@
         self.params['E'] = 0.0       ## <-----                  
         self.params['F'] = 0.0       ## <-----   
+        # Set the name same as the file name
+        self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!!
         ## YOU CAN MODIFY THE LINE BELLOW.MODIFY WORDS BETWEEN """   """  ONLY!!!!
         self.description = """
@@ -88,5 +89,15 @@
 
         return result       ## MODIFY ONLY RESULT. DON'T DELETE RETURN!!!!
-
+    
+    ## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!       
+    def get_fname(self):
+        """
+        Get the model name same as the file name
+        """
+        path = sys._getframe().f_code.co_filename
+        basename  = os.path.basename(path)
+        name, _ = os.path.splitext(basename)
+        return name
+            
 ###############################################################################
 ## THIS IS FOR TEST. DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!       
Index: fittingview/src/sans/perspectives/fitting/plugin_models/sph_bessel_jn.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/plugin_models/sph_bessel_jn.py	(revision 19e614a88b2cede7e0b229c9b1a8813b1d5a6490)
+++ fittingview/src/sans/perspectives/fitting/plugin_models/sph_bessel_jn.py	(revision 316e23141b5dbc6d16b566d2c0d4f1093176139c)
@@ -19,5 +19,6 @@
 import numpy                 ##DO NOT CHANGE THIS LINE!!!
 import scipy.special            ##CHANGE THIS LINE WITH CAUTION!!!
-
+import os
+import sys
 ##PLEASE READ COMMENTS CAREFULLY !!! COMMENT ARE IN CAPITAL LETTERS AND AFTER ##
 ## THESE COMMENTS ARE THERE TO GUIDE YOU. YOU CAN REMOVE THEM ONLY WHEN YOU ARE
@@ -34,7 +35,5 @@
     ##EXAMPLE: Class that evaluates a polynomial model. 
     """
-    ## YOU CAN MODIFY THE LINE BELLOW. CHANGE ONLY WORDS BETWEEN " " 
-    ## TO RENAME YOUR MODEL
-    name = "sph_bessel_jn" ## <----- FILE NAME (NAME OF THE MODEL)   
+    name = "" 
                                 
     def __init__(self):      ##DO NOT CHANGE THIS LINE!!!
@@ -47,5 +46,6 @@
         ## DELETE MODIFIABLE LINE HERE WILL REDUCE THE NUMBER OF PARAMETERS
         self.params = {}                ##DO NOT CHANGE THIS LINE!!!
-        
+        # Set the name same as the file name
+        self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!!
         ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
         ## YOU CAN ALSO DELETE THIS LINE
@@ -112,5 +112,15 @@
 
         return result ## MODIFY ONLY RESULT. DON'T DELETE RETURN!!!!
-
+    
+    ## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!      
+    def get_fname(self):
+        """
+        Get the model name same as the file name
+        """
+        path = sys._getframe().f_code.co_filename
+        basename  = os.path.basename(path)
+        name, _ = os.path.splitext(basename)
+        return name
+            
 ###############################################################################   
 ## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!       
Index: fittingview/src/sans/perspectives/fitting/plugin_models/sum_Ap1_1_Ap2.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/plugin_models/sum_Ap1_1_Ap2.py	(revision 19e614a88b2cede7e0b229c9b1a8813b1d5a6490)
+++ fittingview/src/sans/perspectives/fitting/plugin_models/sum_Ap1_1_Ap2.py	(revision 316e23141b5dbc6d16b566d2c0d4f1093176139c)
@@ -2,5 +2,6 @@
 import copy
 from sans.models.pluginmodel import Model1DPlugin
-
+import os
+import sys
 """
 ## *****************************************************************************
@@ -43,5 +44,5 @@
     Note: P(Q) refers to 'form factor' model.
     """
-    name = "sum_Ap1_1_Ap2" ## <----- FILE NAME (NAME OF THE MODEL) 
+    name = ""  
     def __init__(self):
         Model1DPlugin.__init__(self, name=self.name)
@@ -55,5 +56,6 @@
         self.description = ""
         self.fill_description(p_model1, p_model2)
-
+        # Set the name same as the file name
+        self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!!
         ## Define parameters
         self.params = {}
@@ -391,5 +393,15 @@
                                         ( p_model1.name, p_model2.name )
         self.description += description
-
+    
+    ## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!       
+    def get_fname(self):
+        """
+        Get the model name same as the file name
+        """
+        path = sys._getframe().f_code.co_filename
+        basename  = os.path.basename(path)
+        name, _ = os.path.splitext(basename)
+        return name
+            
 ### FOR TEST                
 if __name__ == "__main__": 
Index: fittingview/src/sans/perspectives/fitting/plugin_models/sum_p1_p2.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/plugin_models/sum_p1_p2.py	(revision 19e614a88b2cede7e0b229c9b1a8813b1d5a6490)
+++ fittingview/src/sans/perspectives/fitting/plugin_models/sum_p1_p2.py	(revision 316e23141b5dbc6d16b566d2c0d4f1093176139c)
@@ -2,5 +2,6 @@
 import copy
 from sans.models.pluginmodel import Model1DPlugin
-
+import os
+import sys
 """
 ## *****************************************************************************
@@ -48,5 +49,5 @@
     Note: P(Q) refers to 'form factor' model.
     """
-    name = "sum_p1_p2" ## <----- FILE NAME (NAME OF THE MODEL) 
+    name = "" 
     def __init__(self):
         Model1DPlugin.__init__(self, name=self.name)
@@ -63,5 +64,6 @@
         self.description += p_model2.name+"\n"
         self.fill_description(p_model1, p_model2)
-
+        # Set the name same as the file name
+        self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!!
         ## Define parameters
         self.params = {}
@@ -399,5 +401,15 @@
                                         ( p_model1.name, p_model2.name )
         self.description += description
-        
+    
+    ## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!       
+    def get_fname(self):
+        """
+        Get the model name same as the file name
+        """
+        path = sys._getframe().f_code.co_filename
+        basename  = os.path.basename(path)
+        name, _ = os.path.splitext(basename)
+        return name
+            
 if __name__ == "__main__": 
     m1= Model() 
Index: fittingview/src/sans/perspectives/fitting/plugin_models/testmodel.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/plugin_models/testmodel.py	(revision 19e614a88b2cede7e0b229c9b1a8813b1d5a6490)
+++ fittingview/src/sans/perspectives/fitting/plugin_models/testmodel.py	(revision 316e23141b5dbc6d16b566d2c0d4f1093176139c)
@@ -18,5 +18,6 @@
 import math                  ##DO NOT CHANGE THIS LINE!!!
 import numpy               ##DO NOT CHANGE THIS LINE!!!
-
+import os
+import sys
 ##PLEASE READ COMMENTS CAREFULLY !!! COMMENT ARE IN CAPITAL LETTERS AND AFTER ##
 ## THESE COMMENTS ARE THERE TO GUIDE YOU. YOU CAN REMOVE THEM ONLY WHEN YOU ARE
@@ -33,8 +34,5 @@
     ##EXAMPLE:Class that evaluates a cos(x) model. 
     """
-    
-    ## YOU CAN MODIFY THE LINE BELLOW. CHANGE ONLY WORDS BETWEEN " " 
-    ## TO RENAME YOUR MODEL
-    name = "testmodel"      ## <----- FILE NAME (NAME OF THE MODEL)   
+    name = ""     
     
     def __init__(self):
@@ -47,4 +45,6 @@
         ## DELETE MODIFIABLE LINE HERE WILL REDUCE THE NUMBER OF PARAMETERS
         self.params = {}                        ##DO NOT CHANGE THIS LINE!!!
+        # Set the name same as the file name
+        self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!!
         ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
         ## YOU CAN ALSO DELETE THIS LINE
@@ -86,4 +86,14 @@
         return self.params['A']+self.params['B']*math.cos(2.0*x)+self.params['C']*math.sin(2.0*x)
     
+    ## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!   
+    def get_fname(self):
+        """
+        Get the model name same as the file name
+        """
+        path = sys._getframe().f_code.co_filename
+        basename  = os.path.basename(path)
+        name, _ = os.path.splitext(basename)
+        return name
+    
 ## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!       
 if __name__ == "__main__": 
Index: fittingview/src/sans/perspectives/fitting/plugin_models/testmodel_2.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/plugin_models/testmodel_2.py	(revision 19e614a88b2cede7e0b229c9b1a8813b1d5a6490)
+++ fittingview/src/sans/perspectives/fitting/plugin_models/testmodel_2.py	(revision 316e23141b5dbc6d16b566d2c0d4f1093176139c)
@@ -18,5 +18,6 @@
 import math                     ##DO NOT CHANGE THIS LINE!!!
 import numpy                    ##DO NOT CHANGE THIS LINE!!!
-
+import os
+import sys
 ##PLEASE READ COMMENTS CAREFULLY !!! COMMENT ARE IN CAPITAL LETTERS AND AFTER ##
 ## THESE COMMENTS ARE THERE TO GUIDE YOU. YOU CAN REMOVE THEM ONLY WHEN YOU ARE
@@ -33,7 +34,5 @@
     ##EXAMPLE: Class that evaluates a polynomial model. 
     """
-    ## YOU CAN MODIFY THE LINE BELLOW. CHANGE ONLY WORDS BETWEEN " " 
-    ## TO RENAME YOUR MODEL
-    name = "testmodel_2" ## <----- FILE NAME (NAME OF THE MODEL)  
+    name = "" 
                                 
     def __init__(self):      ##DO NOT CHANGE THIS LINE!!!
@@ -46,5 +45,6 @@
         ## DELETE MODIFIABLE LINE HERE WILL REDUCE THE NUMBER OF PARAMETERS
         self.params = {}                ##DO NOT CHANGE THIS LINE!!!
-        
+        # Set the name same as the file name
+        self.name = self.get_fname()     ##DO NOT CHANGE THIS LINE!!!
         ## YOU CAN MODIFY THE LINE BELLOW.CHANGE WORD BETWEEN ' ' AND NUMBER 
         ## YOU CAN ALSO DELETE THIS LINE
@@ -148,5 +148,15 @@
 
         return result ## MODIFY ONLY RESULT. DON'T DELETE RETURN!!!!
-    
+
+    ## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!   
+    def get_fname(self):
+        """
+        Get the model name same as the file name
+        """
+        path = sys._getframe().f_code.co_filename
+        basename  = os.path.basename(path)
+        name, _ = os.path.splitext(basename)
+        return name
+                
 ## DO NOT MODIFY THE FOLLOWING LINES!!!!!!!!!!!!!!!!       
 if __name__ == "__main__": 
