title: Django Model Field Auto-Updates Depending on Related Instances
body: <p>I am looking for a solution to being able to automatically update model instances depending on a related model instance.  </p>
  
  <p>It seems simple and I've looked everywhere. I'm new to this so let me know I am asking the question incorrectly or thinking about it in the wrong way.</p>
  
  <p>I need Account.monthly_donations to automatically update to the total amount of all of it's related donations in the last 30 days.  Similarly for yearly_donations and lifetime_donations.</p>
  
  <p>I also need Account.is_subscribed to toggle True if </p>
  
  <ul>
  <li>monthly_donations >= 20, or </li>
  <li>yearly_donations >= 200 or </li>
  <li>lifetime_donations >= 10000</li>
  </ul>
  
  <p>and then back to False if requirements not met.</p>
  
  <pre><code>class Account(models.Model):
      ...
      is_subscribed = models.BooleanField(
          default=False
      )
      monthly_donations = models.PositiveIntegerField(
          default=0
      )
      yearly_donations = models.PositiveIntegerField(
          default=0
      )
      lifetime_donations = models.PositiveIntegerField(
          default=0
      )
  
  
  class Donation(models.Model):
      related_account = models.ForeignKey(
          Account,
          on_delete=models.CASCADE,
          related_name='donation'
      )
      amount = models.IntegerField()
      date = models.DateField()
  </code></pre>
  
  <p>Are signals the solution?  However, I don't want the totals to update only when a new donation is saved.  I need it updated daily based on the donations dates.</p>