url.py 文件源码

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

项目:gtool 作者: gtoolframework 项目源码 文件源码
def __validate__(self, valuedict):
        _public = valuedict.get('public', None)
        if _public is None:
            public = 0 # False
        else:
            public = strtobool('%s' % _public)
            warnings.warn('public check does not currently work due a problem in the underlying validators library')
        try:
            url(self.__value__, public=public) # TODO public / private test doesn't work
        except ValidationFailure:
            raise ValueError('Was expecting a valid %s but got %s' % ('public URL' if public else 'URL', len(self.__value__)))
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号