title: Delete an object automatically after 5 minutes
body: <p>I'm trying to create a function that automatically delete an object after 5 minutes from publication.</p>
  
  <pre><code>from django.contrib.gis.db import models
  from django.utils import timezone
  
  import datetime
  
  class Event(models.Model):
      name = models.CharField(
          max_length=100,
          )
      publishing_date = models.DateTimeField(
      default=timezone.now,
      blank=True,
      )
  
      @property
      def delete_after_five_minutes(self):
          time = self.publishing_date + datetime.timedelta(minutes=5)
          if time &gt; datetime.datetime.now():
              e = Event.objects.get(pk=self.pk)
              e.delete()
              return True
          else:
              return False
  </code></pre>
  
  <p>The problem is that all objects are deleted and not only the objects that I wish.</p>