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]