title: django model method fails database commit
body: <p>The Configuration model below allows for uploading of a .ZIP and ties the extracted network device .TXT files within to the location where the device configurations came from.</p>
  
  <pre><code>class Configuration(models.Model):
      configfile = models.FileField('Configuration File Upload', upload_to='somecompany/configs/', help_text='Select a .ZIP file which contains .TXT file configuration dumps from devices which belong to a single location.')
      location_name = models.ForeignKey('Location', help_text='Associate the .ZIP file selected above to the location from which the device .TXT file configuration dumps were taken.')
  </code></pre>
  
  <p>I extended the default SAVE model method for the class to allow for processing of the .ZIP (code not shown for brevity).  I've parsed the extracted .TXT files, collected all of the desired information into variables, and I'm trying to insert that information into my database but it's failing.  Specifically, below I show an example of all of the values collected from a single one of the extracted .TXT files (modified slightly for privacy) and my attempt at DB insertion:</p>
  
  <pre><code>dbadd_ln = 'Red Rock'
  dbadd_dn = 'DEVICE4'
  dbadd_manu = 'cisco'
  dbadd_os = 'nxos'
  dbadd_dt = '-'
  dbadd_prot = '-'
  dbadd_cred = '-'
  dbadd_ser = 'ABCD1234'
  dbadd_addr = '10.10.10.10'
  dbadd_model = 'N7K-C7010'
  dbadd_ram = '2048256000'
  dbadd_flash = '1109663744/1853116416'
  dbadd_image = 'n7000-s1-dk9.5.2.9.bin'
  dbadd = Device(location_name=dbadd_ln, device_name=dbadd_dn, device_type=dbadd_dt, protocol=dbadd_prot, credential=dbadd_cred, serial=dbadd_ser, address=dbadd_addr, manufacturer=dbadd_manu, model=dbadd_model, ram=dbadd_ram, flash=dbadd_flash, os=dbadd_os, image=dbadd_image)
  Traceback (most recent call last):
    File "&lt;console&gt;", line 1, in &lt;module&gt;
    File "c:\code-projects\MYVIRTUALENV\lib\site-packages\django\db\models\base.py", line 431, in __init__
      setattr(self, field.name, rel_obj)
    File "c:\code-projects\MYVIRTUALENV\lib\site-packages\django\db\models\fields\related_descriptors.py", line 207, in __set__
      self.field.remote_field.model._meta.object_name,
  ValueError: Cannot assign "'Red Rock'": "Device.location_name" must be a "Location" instance.
  </code></pre>
  
  <p>'Red Rock' is a legitimate Location entry which already exists in my database...</p>
  
  <pre><code>&gt;&gt;&gt; Location.objects.filter(location_name='Red Rock')
  [Location: Red Rock]
  </code></pre>
  
  <p>... so I guess I'm unclear on what this really means:</p>
  
  <pre><code>"Device.location_name" must be a "Location" instance.
  </code></pre>
  
  <p>Any assistance to help resolve this issue is appreciated.  Thanks in advance.</p>