title: Python/Django Strange behavior with object dictionary and __dict__
body: <p>I have a portion of a Django project that involves submitting apartment applications into a system and I am noticing strange behavior with finding an application using the ORM and then turning the object into a dict calling <code>__dict__</code> in order to pre-populate a form. </p>
  
  <p>I am curious if anybody can explain either what is happening or what I am doing wrong. Basically, I have a Foreign Key in my <code>UnitApplication</code> model so Applications are mapped to Properties, this database column name and the attribute name in my Model is <code>property_id</code>, however when I turn the object to a dictionary it appends an extra <code>_id</code> to the field name.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>application_id = request.GET.get('application_id')
  application = UnitApplication.objects.using(db_alias).get(id=application_id)
  
  # this is in a view so property_id == Property Object (1)
  print(application.property_id)
  
  # this will print my actual property_id, which is 1
  print(application.property_id.id)
  
  # this is the odd behavior, here is the dict that prints, and hinders form filling
  # {..., 'property_id_id': 1, ...}
  
  print(application.__dict__)
  </code></pre>
  
  <p>What is going on? I can fix this by editing the dict, but I feel like this is buggy.</p>
  
  <p>Here are the relevant parts of my Model in the event you are curious about my naming:</p>
  
  <pre><code>class Property(models.Model):
      # I know this isn't needed but it makes me feel better seeing it here
      id = models.AutoField(primary_key=True)
  
      rental_add_ons = models.ManyToManyField('RentalAddOns', related_name='rental_add_ons')
  
      date_added = models.DateTimeField(auto_now_add=True, editable=False)
  
      ...
  
  class UnitApplication(models.Model):
  
      # property id, set to null if property removed from db
      property_id = models.ForeignKey('Property', 
                                      null=True, 
                                      on_delete=models.SET_NULL,
                                      db_column='property_id')
  </code></pre>
  
  <p><strong>Note:</strong> I am using a regular <code>Form</code> for this because it provided me a bit more freedom, I am not looking for suggestions on changing this around to use a <code>Model Form</code>, I have done that, and although this issue doesn't happen there, it was not ideal for my needs.</p>