title: Using self.id to populate other fields in Django
body: <p>I'm trying to populate a field called 'identification' using the primary key 'id'. However, as you know, there is no way to know what 'id' an objects is going to be before it has been saved. Therefore, stubbornly I did this:</p>
  
  <pre><code>def save(self, *args, **kwargs):
      super(Notifications, self).save(*args, **kwargs)
      self.identification = str(self.id)
  </code></pre>
  
  <p>Amusingly, this works in console:</p>
  
  <pre><code>&gt;&gt;&gt;new = Notifications.objects.create( # some fields to be filled )
  &gt;&gt;&gt;new.identification
  '3' (# or whatever number)
  </code></pre>
  
  <p>but when I go to my template to retrieve this object:</p>
  
  <pre><code>{% for each in notifications %}
    Identification: {{ each.identification }}
  {% endfor %}
  </code></pre>
  
  <p>reality strikes:</p>
  
  <pre><code>Identification: 
  </code></pre>
  
  <p>What is happening? Why is it working in console but not in a template?. What approach do you suggest to use an auto-populated field in other fields?.</p>
  
  <p>Thanks a lot!</p>