Python django.contrib.auth.forms 模块,ReadOnlyPasswordHashWidget() 实例源码

我们从Python开源项目中,提取了以下10个代码示例,用于说明如何使用django.contrib.auth.forms.ReadOnlyPasswordHashWidget()

项目:django-bootstrap4    作者:zostera    | 项目源码 | 文件源码
def add_class_attrs(self, widget=None):
        if widget is None:
            widget = self.widget
        classes = widget.attrs.get('class', '')
        if ReadOnlyPasswordHashWidget is not None and isinstance(widget, ReadOnlyPasswordHashWidget):
            # Render this is a static control
            classes = add_css_class(classes, 'form-control-static', prepend=True)
        elif not isinstance(widget, self.WIDGETS_NO_FORM_CONTROL):
            classes = add_css_class(classes, 'form-control', prepend=True)
            # For these widget types, add the size class here
            classes = add_css_class(classes, self.get_size_class())

        if self.field.errors:
            if self.error_css_class:
                classes = add_css_class(classes, self.error_css_class)
        else:
            if self.field.form.is_bound:
                classes = add_css_class(classes, self.success_css_class)

        widget.attrs['class'] = classes
项目:celery-monitor    作者:jimmy201602    | 项目源码 | 文件源码
def add_class_attrs(self, widget=None):
        if not widget:
            widget = self.widget

        # for multiwidgets we recursively update classes for each sub-widget
        if isinstance(widget, AdminSplitDateTime):
            for w in widget.widgets:
                self.add_class_attrs(w)
            return

        classes = widget.attrs.get('class', '')
        if isinstance(widget, ReadOnlyPasswordHashWidget):
            classes = add_css_class(classes, 'form-control-static', prepend=True)
        elif isinstance(widget, (AdminDateWidget,
                                 AdminTimeWidget,
                                 RelatedFieldWidgetWrapper)):
            # for some admin widgets we don't want the input to take full horizontal space
            classes = add_css_class(classes, 'form-control form-control-inline', prepend=True)
        elif not isinstance(widget, (CheckboxInput,
                                     RadioSelect,
                                     CheckboxSelectMultiple,
                                     FileInput)):
            classes = add_css_class(classes, 'form-control', prepend=True)
            # For these widget types, add the size class here
            classes = add_css_class(classes, self.get_size_class())
        widget.attrs['class'] = classes
项目:django-bootstrap4    作者:GabrielUlici    | 项目源码 | 文件源码
def add_class_attrs(self, widget=None):
        if widget is None:
            widget = self.widget
        classes = widget.attrs.get('class', '')
        if ReadOnlyPasswordHashWidget is not None and isinstance(widget, ReadOnlyPasswordHashWidget):
            # Render this is a static control
            classes = add_css_class(classes, 'form-control-static', prepend=True)
        elif not isinstance(widget, self.WIDGETS_NO_FORM_CONTROL):
            classes = add_css_class(classes, 'form-control', prepend=True)
            # For these widget types, add the size class here
            classes = add_css_class(classes, self.get_size_class())
        widget.attrs['class'] = classes
项目:django-learning    作者:adoggie    | 项目源码 | 文件源码
def add_class_attrs(self, widget=None):
        if widget is None:
            widget = self.widget
        classes = widget.attrs.get('class', '')
        if isinstance(widget, ReadOnlyPasswordHashWidget):
            # Render this is a static control
            classes = add_css_class(classes, 'form-control-static', prepend=True)
        elif not isinstance(widget, self.WIDGETS_NO_FORM_CONTROL):
            classes = add_css_class(classes, 'form-control', prepend=True)
            # For these widget types, add the size class here
            classes = add_css_class(classes, self.get_size_class())
        widget.attrs['class'] = classes
项目:django-propeller    作者:tfroehlich82    | 项目源码 | 文件源码
def add_class_attrs(self, widget=None):
        if widget is None:
            widget = self.widget
        classes = widget.attrs.get('class', '')
        if ReadOnlyPasswordHashWidget is not None and isinstance(widget, ReadOnlyPasswordHashWidget):
            # Render this is a static control
            classes = add_css_class(classes, 'form-control-static', prepend=True)
        elif not isinstance(widget, self.WIDGETS_NO_FORM_CONTROL):
            classes = add_css_class(classes, 'form-control', prepend=True)
            # For these widget types, add the size class here
            classes = add_css_class(classes, self.get_size_class())
        widget.attrs['class'] = classes
项目:SSBW    作者:AythaE    | 项目源码 | 文件源码
def add_class_attrs(self, widget=None):
        if widget is None:
            widget = self.widget
        classes = widget.attrs.get('class', '')
        if ReadOnlyPasswordHashWidget is not None and isinstance(widget, ReadOnlyPasswordHashWidget):
            # Render this is a static control
            classes = add_css_class(classes, 'form-control-static', prepend=True)
        elif not isinstance(widget, self.WIDGETS_NO_FORM_CONTROL):
            classes = add_css_class(classes, 'form-control', prepend=True)
            # For these widget types, add the size class here
            classes = add_css_class(classes, self.get_size_class())
        widget.attrs['class'] = classes
项目:SSBW    作者:AythaE    | 项目源码 | 文件源码
def add_class_attrs(self, widget=None):
        if widget is None:
            widget = self.widget
        classes = widget.attrs.get('class', '')
        if ReadOnlyPasswordHashWidget is not None and isinstance(widget, ReadOnlyPasswordHashWidget):
            # Render this is a static control
            classes = add_css_class(classes, 'form-control-static', prepend=True)
        elif not isinstance(widget, self.WIDGETS_NO_FORM_CONTROL):
            classes = add_css_class(classes, 'form-control', prepend=True)
            # For these widget types, add the size class here
            classes = add_css_class(classes, self.get_size_class())
        widget.attrs['class'] = classes
项目:SSBW    作者:AythaE    | 项目源码 | 文件源码
def add_class_attrs(self, widget=None):
        if widget is None:
            widget = self.widget
        classes = widget.attrs.get('class', '')
        if ReadOnlyPasswordHashWidget is not None and isinstance(widget, ReadOnlyPasswordHashWidget):
            # Render this is a static control
            classes = add_css_class(classes, 'form-control-static', prepend=True)
        elif not isinstance(widget, self.WIDGETS_NO_FORM_CONTROL):
            classes = add_css_class(classes, 'form-control', prepend=True)
            # For these widget types, add the size class here
            classes = add_css_class(classes, self.get_size_class())
        widget.attrs['class'] = classes
项目:SSBW    作者:AythaE    | 项目源码 | 文件源码
def add_class_attrs(self, widget=None):
        if widget is None:
            widget = self.widget
        classes = widget.attrs.get('class', '')
        if ReadOnlyPasswordHashWidget is not None and isinstance(widget, ReadOnlyPasswordHashWidget):
            # Render this is a static control
            classes = add_css_class(classes, 'form-control-static', prepend=True)
        elif not isinstance(widget, self.WIDGETS_NO_FORM_CONTROL):
            classes = add_css_class(classes, 'form-control', prepend=True)
            # For these widget types, add the size class here
            classes = add_css_class(classes, self.get_size_class())
        widget.attrs['class'] = classes
项目:SSBW    作者:AythaE    | 项目源码 | 文件源码
def add_class_attrs(self, widget=None):
        if widget is None:
            widget = self.widget
        classes = widget.attrs.get('class', '')
        if ReadOnlyPasswordHashWidget is not None and isinstance(widget, ReadOnlyPasswordHashWidget):
            # Render this is a static control
            classes = add_css_class(classes, 'form-control-static', prepend=True)
        elif not isinstance(widget, self.WIDGETS_NO_FORM_CONTROL):
            classes = add_css_class(classes, 'form-control', prepend=True)
            # For these widget types, add the size class here
            classes = add_css_class(classes, self.get_size_class())
        widget.attrs['class'] = classes