'Delete entries that exceed the amount we want to keep.'

def delete_old_entries(self):

    if (not (self.keep > 0)):
        return
    to_delete = self.entries.order_by('-last_published')[self.keep:]
    for item in to_delete:
        item.delete()
