當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。