decorators.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:dit-thumber 作者: uktrade 项目源码 文件源码
def thumber_feedback(view):
    # Cannot wrap view functions or classes that don't inherit from class-based View
    if type(view) is types.FunctionType or not issubclass(view, View):
        raise ImproperlyConfigured('Only class-based views can be decorated with `thumber_feedback')

    # Make a new class that inherits from the ThumberView, and the wrapped view class
    return type('ThumberFeedbackView', (ThumberView, view,), {})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号