title: Django Delete all but last five of queryset
body: <p>I have a super simple django model here:</p>
  
  <pre><code>class Notification(models.Model):
      message = models.TextField()
      user = models.ForeignKey(User)
      timestamp = models.DateTimeField(default=datetime.datetime.now)
  </code></pre>
  
  <p>Using ajax, I check for new messages every minute. I only show the five most recent notifications to the user at any time. What I'm trying to avoid, is the following scenario.</p>
  
  <p>User logs in and has no notifications. While the user's window is up, he receives 10 new messages. Since I'm only showing him five, no big deal. The problem happens when the user starts to delete his notifications. If he deletes the five that are displayed, the five older ones will be displayed on the next ajax call or refresh.</p>
  
  <p>I'd like to have my model's save method delete everything but the 5 most recent objects whenever a new one is saved. Unfortunately, you can't use [5:] to do this. Help?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I tried this which didn't work as expected (in the model's save method):</p>
  
  <pre><code>    notes = Notification.objects.filter(user=self.user)[:4]
      Notification.objects.exclude(pk__in=notes).delete()
  </code></pre>
  
  <p>i couldn't find a pattern in strange behavior, but after a while of testing, it would only delete the most recent one when a new one was created. i have NO idea why this would be. the ordering is taken care of in the model's Meta class (by timestamp descending). thanks for the help, but my way seems to be the only one that works consistently.</p>