title: Django: How to access original (unmodified) instance in post_save signal
body: <p>I want to do a data denormalization for better performance, and put a sum of votes my blog post receives inside Post model:</p>
  
  <pre><code>class Post(models.Model):
      """ Blog entry """
      author          = models.ForeignKey(User)
      title           = models.CharField(max_length=255)
      text            = models.TextField()
      rating          = models.IntegerField(default=0) # here is the sum of votes!
  
  class Vote(models.Model):
      """ Vote for blog entry """
      post            = models.ForeignKey(Post)
      voter           = models.ForeignKey(User)
      value           = models.IntegerField()
  </code></pre>
  
  <p>Ofcourse, I need to keep <code>Post.rating</code> value actual. Nornally I would use database triggers for that, but now I've decided to make a <code>post_save</code> signal (to reduce database process time):</p>
  
  <pre><code># vote was saved
  @receiver(post_save, sender=Vote)
  def update_post_votes(sender, instance, created, **kwargs):
      """ Update post rating """
      if created:
          instance.post.rating += instance.value
          instance.post.save()
      else:
          # if vote was updated, we need to remove the old vote value and add the new one
          # but how...?
  </code></pre>
  
  <p>How can I access the instance value before it was saved? In database triggers, i would have <code>OLD</code> and <code>NEW</code> predefines for this, but is there something like this in post_save signals?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The solution based on Mark's the answer:</p>
  
  <pre><code># vote was saved
  @receiver(pre_save, sender=Vote)
  def update_post_votes_on_save(sender, instance, **kwargs):
      """ Update post rating """
      # if vote is being updated, then we must remove previous value first
      if instance.id:
          old_vote = Vote.objects.get(pk=instance.id)
          instance.post.rating -= old_vote.value
      # now adding the new vote
      instance.post.rating += instance.value
      instance.post.save()
  </code></pre>