当前位置: 首页>>代码示例>>Python>>正文


Python layout.Field方法代码示例

本文整理汇总了Python中crispy_forms.layout.Field方法的典型用法代码示例。如果您正苦于以下问题:Python layout.Field方法的具体用法?Python layout.Field怎么用?Python layout.Field使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在crispy_forms.layout的用法示例。


在下文中一共展示了layout.Field方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from crispy_forms import layout [as 别名]
# 或者: from crispy_forms.layout import Field [as 别名]
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper(self)
        self.helper.layout = Layout(
            layout.Fieldset(
                '',
                layout.Field('recipient', readonly=True),
                'subject',
                'body',
                'referenced_post',
            ),
            bootstrap.FormActions(
                Submit('submit', 'Send Message', css_class='btn btn-success'),
            )
        )
        self.helper.form_tag = False 
开发者ID:klingj3,项目名称:django-marketplace,代码行数:18,代码来源:forms.py

示例2: __init__

# 需要导入模块: from crispy_forms import layout [as 别名]
# 或者: from crispy_forms.layout import Field [as 别名]
def __init__(self, *args, **kwargs):
        super(MonsterPieceForm, self).__init__(*args, **kwargs)

        self.helper = FormHelper(self)
        self.helper.form_class = 'ajax-form'
        self.helper.include_media = False
        self.helper.layout = Layout(
            Field(
                'monster',
                data_toggle='popover',
                data_trigger='focus',
                data_container='body',
                title='Autocomplete Tips',
                data_content="Enter the monster's awakened or unawakened name (either will work). To further narrow results, type the element too. Example: \"Raksha water\" will list water Rakshasa and Su",
            ),
            Field('pieces'),
            FormActions(
                Submit('save', 'Save', css_class='btn btn-primary'),
                Button('cancel', 'Cancel', css_class='btn btn-link', data_dismiss='modal')
            ),
        ) 
开发者ID:PeteAndersen,项目名称:swarfarm,代码行数:23,代码来源:forms.py

示例3: __init__

# 需要导入模块: from crispy_forms import layout [as 别名]
# 或者: from crispy_forms.layout import Field [as 别名]
def __init__(self, request, *args, **kwargs):
        self.request = request
        super().__init__(*args, **kwargs)

        id_field = layout.Field("id")
        language_field = layout.Field("language", css_class="input-block-level")
        title_field = layout.Field("title", css_class="input-block-level")
        content_field = layout.Field("content", css_class="input-block-level", rows="3")
        delete_field = layout.Field("DELETE")
        main_fieldset = layout.Fieldset(
            _("Main data"),
            id_field,
            language_field,
            title_field,
            content_field,
            delete_field,
        )

        self.helper = helper.FormHelper()
        self.helper.form_tag = False
        self.helper.disable_csrf = True
        self.helper.layout = layout.Layout(main_fieldset) 
开发者ID:PacktPublishing,项目名称:Django-3-Web-Development-Cookbook-Fourth-Edition,代码行数:24,代码来源:forms.py

示例4: convert_field

# 需要导入模块: from crispy_forms import layout [as 别名]
# 或者: from crispy_forms.layout import Field [as 别名]
def convert_field(self, f, counts):
        col_class = "col-sm-%d" % int(math.ceil(12 / counts))
        if not (isinstance(f, Field) or issubclass(f.__class__, Field)):
            f = layout.Field(f)
        if f.wrapper_class:
            f.wrapper_class += " %s" % col_class
        else:
            f.wrapper_class = col_class
        return f 
开发者ID:stormsha,项目名称:StormOnline,代码行数:11,代码来源:layout.py

示例5: get_layout

# 需要导入模块: from crispy_forms import layout [as 别名]
# 或者: from crispy_forms.layout import Field [as 别名]
def get_layout(self, helper):
        items = [Field(x, wrapper_class="form-group") for x in self.fields]
        action = FormActions(Submit('submit', _(u'查询')),
                             css_class="form-group")
        items.append(action)
        layout = Layout(*items)
        return layout 
开发者ID:momosecurity,项目名称:aswan,代码行数:9,代码来源:forms.py

示例6: __init__

# 需要导入模块: from crispy_forms import layout [as 别名]
# 或者: from crispy_forms.layout import Field [as 别名]
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.helper = FormHelper()
        self.helper.form_action = ""
        self.helper.form_method = "POST"
        self.helper.layout = layout.Layout(
            layout.Field("title"),
            layout.Field(
                "categories",
                template="utils/checkbox_multi_select_tree.html"),
            bootstrap.FormActions(
                layout.Submit("submit", _("Save")),
            )
        ) 
开发者ID:PacktPublishing,项目名称:Django-2-Web-Development-Cookbook-Third-Edition,代码行数:17,代码来源:forms.py


注:本文中的crispy_forms.layout.Field方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。