當前位置: 首頁>>代碼示例>>Python>>正文


Python layout.Div方法代碼示例

本文整理匯總了Python中crispy_forms.layout.Div方法的典型用法代碼示例。如果您正苦於以下問題:Python layout.Div方法的具體用法?Python layout.Div怎麽用?Python layout.Div使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在crispy_forms.layout的用法示例。


在下文中一共展示了layout.Div方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Div [as 別名]
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        for field_name in ['groups', 'target_id']:
            self.fields.pop(field_name, None)
        for field in self.fields:
            if field != 'strategy_name':
                self.fields[field].required = False
        self.helper.layout = Layout(
            self.common_layout,
            Div(
                Div(
                    'proposal', 'ipp_value', 'filter', 'instrument_type',
                    css_class='col'
                ),
                Div(
                    'exposure_count', 'exposure_time', 'max_airmass',
                    css_class='col'
                ),
                css_class='form-row',
            )
        ) 
開發者ID:TOMToolkit,項目名稱:tom_base,代碼行數:23,代碼來源:lco.py

示例2: layout

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Div [as 別名]
def layout(self):
        return Div(
            Div('name', 'observation_id'),
            Div(
                Div('start', css_class='col'),
                Div('end', css_class='col'),
                css_class='form-row'
            ),
            Div('observation_params')
        ) 
開發者ID:TOMToolkit,項目名稱:tom_base,代碼行數:12,代碼來源:facility.py

示例3: layout

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Div [as 別名]
def layout(self):
        return Div(
            Div(
                Div(
                    'name', 'proposal', 'ipp_value', 'observation_mode', 'start', 'end',
                    css_class='col'
                ),
                Div(
                    'filter', 'instrument_type', 'exposure_count', 'exposure_time', 'max_airmass',
                    css_class='col'
                ),
                css_class='form-row',
            ),
            Div(
                HTML('<p>Cadence parameters. Leave blank if no cadencing is desired.</p>'),
            ),
            Div(
                Div(
                    'period',
                    css_class='col'
                ),
                Div(
                    'jitter',
                    css_class='col'
                ),
                css_class='form-row'
            ),
        ) 
開發者ID:TOMToolkit,項目名稱:tom_base,代碼行數:30,代碼來源:lco.py

示例4: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Div [as 別名]
def __init__(self, *args, **kwargs):
        self.helper = FormHelper()
        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-md-2'
        self.helper.field_class = 'col-md-8'
        self.helper.layout = Layout(*[Div(field, css_class='form-group')
                                      for field in ['user', 'newpassword1', 'newpassword2', 'email']])
        self.instance = False
        if 'instance' in kwargs.keys():
            kwargs.pop('instance')
            self.instance = True
        super(RegisterForm, self).__init__(*args, **kwargs) 
開發者ID:jimmy201602,項目名稱:webterminal,代碼行數:14,代碼來源:forms.py

示例5: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Div [as 別名]
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.helper = FormHelper()

        self.helper.form_class = 'form-horizontal'
        self.helper.label_class = 'col-md-2'
        self.helper.field_class = 'col-md-8'
        self.helper.layout = Layout(*[Div(field, css_class='form-group') for field in [
                                    'webterminal_detect', 'otp_switch', 'use_tz', 'timezone']]) 
開發者ID:jimmy201602,項目名稱:webterminal,代碼行數:11,代碼來源:forms.py

示例6: layout

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Div [as 別名]
def layout(self):
        return Div(
            HTML('<big>Observation Parameters</big>'),
            HTML('<p>Select the Obsids of one or more templates. <br>'),
            HTML('Setting Ready=No will keep the new observation(s) On Hold. <br>'),
            HTML('If a value is not set, then the template default is used. <br>'),
            HTML('If setting Exptime, then provide a list of values if selecting more than one Obsid.</p>'),
            Div(
                Div(
                    'obsid',
                    css_class='col'
                ),
                Div(
                    'ready',
                    css_class='col'
                ),
                Div(
                    'notetitle',
                    css_class='col'
                ),
                css_class='form-row'
            ),
            Div(
                Div(
                    'posangle', 'brightness', 'eltype', 'group',
                    css_class='col'
                ),
                Div(
                    'exptimes', 'brightness_band', 'elmin', 'window_start',
                    css_class='col'
                ),
                Div(
                    'note', 'brightness_system', 'elmax', 'window_duration',
                    css_class='col'
                ),
                css_class='form-row'
            ),
            HTML('<big>Optional Guide Star Parameters</big>'),
            HTML('<p>If any one of Name/RA/Dec is given, then all must be.</p>'),
            Div(
                Div(
                    'gstarg', 'gsbrightness', 'gsprobe',
                    css_class='col'
                ),
                Div(
                    'gsra', 'gsbrightness_band',
                    css_class='col'
                ),
                Div(
                    'gsdec', 'gsbrightness_system',
                    css_class='col'
                ),
                css_class='form-row',
            )
        ) 
開發者ID:TOMToolkit,項目名稱:tom_base,代碼行數:57,代碼來源:gemini.py

示例7: __init__

# 需要導入模塊: from crispy_forms import layout [as 別名]
# 或者: from crispy_forms.layout import Div [as 別名]
def __init__(self, request, *args, **kwargs):
        self.request = request
        super().__init__(*args, **kwargs)
        geoposition = self.instance.get_geoposition()
        if geoposition:
            self.fields["latitude"].initial = geoposition.latitude
            self.fields["longitude"].initial = geoposition.longitude

        name_field = layout.Field("name", css_class="input-block-level")
        description_field = layout.Field(
            "description", css_class="input-block-level", rows="3"
        )
        main_fieldset = layout.Fieldset(_("Main data"), name_field, description_field)

        picture_field = layout.Field(
            "picture",
            data_url=reverse("upload_file"),
            template="core/includes/file_upload_field.html",
        )
        picture_path_field = layout.Field("picture_path")

        picture_fieldset = layout.Fieldset(
            _("Picture"),
            picture_field,
            picture_path_field,
            title=_("Picture upload"),
            css_id="picture_fieldset",
        )

        street_address_field = layout.Field(
            "street_address", css_class="input-block-level"
        )
        street_address2_field = layout.Field(
            "street_address2", css_class="input-block-level"
        )
        postal_code_field = layout.Field("postal_code", css_class="input-block-level")
        city_field = layout.Field("city", css_class="input-block-level")
        country_field = layout.Field("country", css_class="input-block-level")
        latitude_field = layout.Field("latitude", css_class="input-block-level")
        longitude_field = layout.Field("longitude", css_class="input-block-level")
        address_fieldset = layout.Fieldset(
            _("Address"),
            street_address_field,
            street_address2_field,
            postal_code_field,
            city_field,
            country_field,
            latitude_field,
            longitude_field,
        )

        submit_button = layout.Submit("save", _("Save"))
        actions = bootstrap.FormActions(layout.Div(submit_button, css_class="col"))

        self.helper = helper.FormHelper()
        self.helper.form_action = self.request.path
        self.helper.form_method = "POST"
        self.helper.attrs = {"noValidate": "noValidate"}
        self.helper.layout = layout.Layout(main_fieldset, picture_fieldset, address_fieldset, actions) 
開發者ID:PacktPublishing,項目名稱:Django-3-Web-Development-Cookbook-Fourth-Edition,代碼行數:61,代碼來源:forms.py


注:本文中的crispy_forms.layout.Div方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。