title: wxPython, using a field from an imported class
body: <p>First important to state that I am an amateur programmer.</p>
  
  <p>Building a personal software in python/wxPython connected to a MySQL DB</p>
  
  <p>My problem:</p>
  
  <p>trying to write one form that will access classes from an imported file.
  The form accesses at any one time 4 related tables on the database.</p>
  
  <p>Three(3) of these tables are always the same.  The fourth can be one of two tables.</p>
  
  <p>The tables that are always accessed : session, cardio and notes
  The tables that can vary are: physical or machine</p>
  
  <p>I have placed the data fields in wx.Panel classes for each of the tables mentioned above.  The mainForm's menu calls the input form with a reference to either the physical or the machine parameter.  The appropriate form is displayed with its data fields.</p>
  
  <p>My problem is I can't access these imported fields to load data from the database.</p>
  
  <p>Sections of my code:</p>
  
  <p>Mainform: dailyResultsV2.py</p>
  
  <pre><code>import inputForm as IF
  
  # Menu Event:
  </code></pre>
  
  <p>def OnShowBikeRecs(self, event):</p>
  
  <pre><code>self.bikeedit = IF.inputForm(None, -1, "Bike Record Management", size=(925,650), name="bike")
      self.bikeedit.Show()
      self.bikeedit.Center()
  </code></pre>
  
  <p>Called Form: inputForm.py</p>
  
  <pre><code>class inputForm(wx.Frame):
  def __init__(self, parent, *args, **kwargs):
      wx.Frame.__init__(self, parent, *args, **kwargs)
  
      self.EXERCISE = kwargs['name']
  
  
      # create a panel
      self.panel = wx.Panel(self)
      self.panel.BackgroundColour = (200, 230, 250)
      self.filterSetup()
      self.sessionSection = IFC.tblSession(self.panel,-1)
      self.sessionSection.BackgroundColour = (200, 230, 250)
      if self.EXERCISE == 'walk':
          self.physicalSection = IFC.tblPhysical(self.panel,-1)
      else:
          self.machineSection = IFC.tblMachine(self.panel,-1)
  
      self.cardioSection = IFC.tblcardio(self.panel,-1)
      self.notesSection = IFC.tblNotes(self.panel,-1)
      self.buttonSetup()
      self.topsizer()
  </code></pre>
  
  <p>The preceding class creates an input form which will include all the fields from the physical table or the machine table.</p>
  
  <p>My problem how to I access these fields to add data from the database or update the database.  (One side note this is a physical training database).  </p>
  
  <p>example of the imported classes: inputFormClasses.py</p>
  
  <pre><code>class tblMachine(wx.Panel):    
  def __init__(self, parent, *args, **kwargs):
      wx.Panel.__init__(self, parent, *args, **kwargs)
  
      self.BackgroundColour = (200, 230, 250)
  
      # The columns
      # machine_ID - not displayed        machine_session_FK  - not displayed     machine_level  - not displayed
      # machine_Type_FK   machine_Distance    machine_AvgSpeed   machine_MaxSpeed     machine_Duration     machine_ODO     machine_RunFK - ComboBox           
  
      self.runNames = []      # ComboBox List
  
      self.machineLabel_st = wx.StaticText(self, -1, "Machine", style=wx.ALIGN_LEFT)
      self.machineType_st = wx.StaticText(self, -1, "Type", style=wx.ALIGN_LEFT)
      self.machineType_tc = wx.TextCtrl(self, -1, value="Biking",  style=wx.TE_CENTRE)
      self.machineDistance_st = wx.StaticText(self, -1, "Distance", style=wx.ALIGN_LEFT)
      self.machineDistance_tc = wx.TextCtrl(self, -1, style=wx.TE_CENTRE)
      self.machineAvgSpeed_st = wx.StaticText(self, -1, "Avg. Speed", style=wx.ALIGN_LEFT)
      self.machineAvgSpeed_tc = wx.TextCtrl(self, -1, style=wx.TE_CENTRE)
      self.machineMaxSpeed_st = wx.StaticText(self, -1, "Max Speed", style=wx.ALIGN_LEFT)
      self.machineMaxSpeed_tc = wx.TextCtrl(self, -1, style=wx.TE_CENTRE)
      self.machineDuration_st = wx.StaticText(self, -1, "Duration", style=wx.ALIGN_LEFT)
      self.machineDuration_mtc = masked.TimeCtrl(self, -1, fmt24hr=True)
      self.machineODO_st = wx.StaticText(self, -1, "Odometer", style=wx.ALIGN_LEFT)
      self.machineODO_tc = wx.TextCtrl(self, -1, style=wx.TE_CENTRE)
      self.machineRun_st = wx.StaticText(self, -1, "Run", style=wx.ALIGN_LEFT)
      self.machineRun_cbo = wx.ComboBox(self, -1, choices = self.getRunNames(self.runNames), style=wx.CB_READONLY)  # get the list of runs for comboBox
  
      # create machine sizer
      self.MachineSizer    = wx.GridBagSizer(hgap=5, vgap=5)
  </code></pre>
  
  <p>How to I access for example: self.machineType_tc on my form ?</p>