title: callback on delete from database?
body: <p>My Django app uses Amazon S3 storage for the user's data files that they have uploaded.  I store a pointer (using the uuid) to the file in the model:</p>
  
  <p>model.py:</p>
  
  <pre><code>class Gedcom(models.Model):
  """Gedcom model."""
  
  user = models.ForeignKey(User, on_delete=models.CASCADE)
  filename = models.CharField(max_length=100, default="")
  title = models.CharField(max_length=100, default="")
  uuid = models.CharField(max_length=36, default="")
  </code></pre>
  
  <p>Is there a way to perform a callback of sorts when a gedcom item is deleted (say through either the admin interface or via my other code) that a method is called so that I can delete that file from S3?</p>
  
  <p>I could run a management function as part of a cron job that delete unlinked file on S3 if they no longer exist in the local database, but I'm wondering if there is another way to do this that is cleaner?</p>