Python django.forms.forms 模块,BaseForm() 实例源码

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

项目:deb-python-jingo    作者:openstack    | 项目源码 | 文件源码
def patch():
    from django.forms import forms, formsets, util, widgets

    # Add __html__ methods to these classes:
    classes = [
        forms.BaseForm,
        forms.BoundField,
        formsets.BaseFormSet,
        util.ErrorDict,
        util.ErrorList,
        widgets.Media,
        widgets.RadioFieldRenderer,
    ]
    try:
        classes.append(widgets.RadioChoiceInput)
    except AttributeError:
        classes.append(widgets.RadioInput)

    for cls in classes:
        if not hasattr(cls, '__html__'):
            cls.__html__ = __html__
项目:django-bootstrap4    作者:zostera    | 项目源码 | 文件源码
def __init__(self, form, *args, **kwargs):
        if not isinstance(form, BaseForm):
            raise BootstrapError(
                'Parameter "form" should contain a valid Django Form.')
        self.form = form
        super(FormRenderer, self).__init__(*args, **kwargs)
        self.error_css_class = kwargs.get('error_css_class', None)
        self.required_css_class = kwargs.get('required_css_class', None)
        self.bound_css_class = kwargs.get('bound_css_class', None)
项目:django-bootstrap4    作者:GabrielUlici    | 项目源码 | 文件源码
def __init__(self, form, *args, **kwargs):
        if not isinstance(form, BaseForm):
            raise BootstrapError(
                'Parameter "form" should contain a valid Django Form.')
        self.form = form
        super(FormRenderer, self).__init__(*args, **kwargs)
        self.error_css_class = kwargs.get('error_css_class', None)
        self.required_css_class = kwargs.get('required_css_class', None)
        self.bound_css_class = kwargs.get('bound_css_class', None)
项目:django-learning    作者:adoggie    | 项目源码 | 文件源码
def __init__(self, form, *args, **kwargs):
        if not isinstance(form, BaseForm):
            raise BootstrapError(
                'Parameter "form" should contain a valid Django Form.')
        self.form = form
        super(FormRenderer, self).__init__(*args, **kwargs)
        # Handle form.empty_permitted
        if self.form.empty_permitted:
            self.set_required = False
        self.error_css_class = kwargs.get('error_css_class', None)
        self.required_css_class = kwargs.get('required_css_class', None)
        self.bound_css_class = kwargs.get('bound_css_class', None)
项目:django-propeller    作者:tfroehlich82    | 项目源码 | 文件源码
def __init__(self, form, *args, **kwargs):
        if not isinstance(form, BaseForm):
            raise PropellerError(
                'Parameter "form" should contain a valid Django Form.')
        self.form = form
        super(FormRenderer, self).__init__(*args, **kwargs)

        # Handle form.empty_permitted
        if PROPELLER_SET_REQUIRED_SET_DISABLED and self.form.empty_permitted:
            self.set_required = False

        self.error_css_class = kwargs.get('error_css_class', None)
        self.required_css_class = kwargs.get('required_css_class', None)
        self.bound_css_class = kwargs.get('bound_css_class', None)
项目:SSBW    作者:AythaE    | 项目源码 | 文件源码
def __init__(self, form, *args, **kwargs):
        if not isinstance(form, BaseForm):
            raise BootstrapError(
                'Parameter "form" should contain a valid Django Form.')
        self.form = form
        super(FormRenderer, self).__init__(*args, **kwargs)
        self.error_css_class = kwargs.get('error_css_class', None)
        self.required_css_class = kwargs.get('required_css_class', None)
        self.bound_css_class = kwargs.get('bound_css_class', None)
项目:SSBW    作者:AythaE    | 项目源码 | 文件源码
def __init__(self, form, *args, **kwargs):
        if not isinstance(form, BaseForm):
            raise BootstrapError(
                'Parameter "form" should contain a valid Django Form.')
        self.form = form
        super(FormRenderer, self).__init__(*args, **kwargs)
        self.error_css_class = kwargs.get('error_css_class', None)
        self.required_css_class = kwargs.get('required_css_class', None)
        self.bound_css_class = kwargs.get('bound_css_class', None)
项目:SSBW    作者:AythaE    | 项目源码 | 文件源码
def __init__(self, form, *args, **kwargs):
        if not isinstance(form, BaseForm):
            raise BootstrapError(
                'Parameter "form" should contain a valid Django Form.')
        self.form = form
        super(FormRenderer, self).__init__(*args, **kwargs)
        self.error_css_class = kwargs.get('error_css_class', None)
        self.required_css_class = kwargs.get('required_css_class', None)
        self.bound_css_class = kwargs.get('bound_css_class', None)
项目:SSBW    作者:AythaE    | 项目源码 | 文件源码
def __init__(self, form, *args, **kwargs):
        if not isinstance(form, BaseForm):
            raise BootstrapError(
                'Parameter "form" should contain a valid Django Form.')
        self.form = form
        super(FormRenderer, self).__init__(*args, **kwargs)
        self.error_css_class = kwargs.get('error_css_class', None)
        self.required_css_class = kwargs.get('required_css_class', None)
        self.bound_css_class = kwargs.get('bound_css_class', None)
项目:SSBW    作者:AythaE    | 项目源码 | 文件源码
def __init__(self, form, *args, **kwargs):
        if not isinstance(form, BaseForm):
            raise BootstrapError(
                'Parameter "form" should contain a valid Django Form.')
        self.form = form
        super(FormRenderer, self).__init__(*args, **kwargs)
        self.error_css_class = kwargs.get('error_css_class', None)
        self.required_css_class = kwargs.get('required_css_class', None)
        self.bound_css_class = kwargs.get('bound_css_class', None)