`
san_yun
  • 浏览: 2602128 次
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

python的元注释

 
阅读更多

python 的元注释还是很方便的:

 

@cf.cache_func(name=lambda * args, **kwargs:"blog:top:comments:%s" % args[0].id,
                   expired=60 * 5)
    def get_top_comments(self, n=3):
        from comment.models import Comment
        return Comment.objects.filter(object_id=self.id, category=0).order_by('-add_datetime')[:n]

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics