  
      def save(self, *args, **kwargs):
          self.slug = slugify(self.title)
          super(self.__class__, self).save(*args, **kwargs)
          for obj in self.__class__.objects.order_by('-pk')[MAX_POSTS:]:
              obj.delete()
  
  
  class Comment(models.Model):
      blogpost = models.ForeignKey(BlogPost, editable=False, related_name='comments')
 
</s> remove     class Meta:
        ordering = ('created',)

    @models.permalink
    def get_absolute_url(self):
        return ('blog-post', (), {'key': self.key})

    @property
    @models.permalink
    def comments_url(self):
        """Link to a resource which lists all comments for this blog post."""
        return ('comments', (), {'blogpost': self.key})

    def __unicode__(self):
        return self.title

 </s> add  </s> remove     
    class Meta:
        ordering = ('created',)
 </s> add  </s> remove         """For the purposes of the sandbox, limit the maximum number of stored models."""
 </s> add         """
        For the purposes of the sandbox limit the maximum number of stored models.
        """ </s> remove             MyModel.objects.all()[0].delete()
    
    @models.permalink
    def get_absolute_url(self):
        return ('my-model-resource', (self.pk,))
 </s> add             MyModel.objects.all().order_by('-created')[0].delete()

        for obj in self.__class__.objects.order_by('-created')[MAX_POSTS:]:
  
      def save(self, *args, **kwargs):
          self.slug = slugify(self.title)
          super(self.__class__, self).save(*args, **kwargs)
        for obj in self.__class__.objects.order_by('-created')[MAX_POSTS:]:
              obj.delete()
  
  
  class Comment(models.Model):
      blogpost = models.ForeignKey(BlogPost, editable=False, related_name='comments')
keep keep keep keep replace keep keep keep keep keep
 Fixing some of the last blocking issues 
examples/blogpost/models.py