当前位置: 首页>>代码示例>>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;未经允许,请勿转载。