widgets.py 文件源码

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

项目:tumanov_castleoaks 作者: Roamdev 项目源码 文件源码
def __init__(self, attrs=None):
        color_widget = widgets.TextInput(attrs={
            'type': 'color',
            'class': 'colorfield-preview input-small',
        })
        input_widget = widgets.TextInput(attrs={
            'max_length': 7,
            'placeholder': 'hex color',
            'class': 'colorfield-hex input-small',
            'pattern': '#?([0-9a-fA-F]{6}|[0-9a-fA-F]{3})',
        })
        opacity_widget = widgets.TextInput(attrs={
            'type': 'number',
            'placeholder': 'opacity',
            'class': 'colorfield-opacity input-mini',
            'step': '0.05',
            'min': 0,
            'max': 1,
        })
        _widgets = (color_widget, input_widget, opacity_widget)
        super().__init__(_widgets, attrs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号