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


Python HTML.textarea方法代码示例

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


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

示例1: text_area

# 需要导入模块: from webhelpers.html import HTML [as 别名]
# 或者: from webhelpers.html.HTML import textarea [as 别名]
    def text_area(self, name, content=None, show_errors=True, **options):
        """
        Creates a text input area.

        Options:

        * ``size`` - A string specifying the dimensions of the textarea.

        Example::

            >>> text_area("body", '', size="25x10")
            '<textarea cols="25" id="body" name="body" rows="10"></textarea>'
        """
        if 'size' in options:
            options["cols"], options["rows"] = options["size"].split("x")
            del options['size']
        o = {'name_': name}
        o.update(options)

        if content == None:
            if name in self.defaults:
                content = self.defaults[name]
            else:
                content = ''

        ret = HTML.textarea(content, **o)
        if show_errors:
            ret += self.get_error(name)
        return ret
开发者ID:NetShepsky,项目名称:Ferrox,代码行数:31,代码来源:formgen.py

示例2: textarea

# 需要导入模块: from webhelpers.html import HTML [as 别名]
# 或者: from webhelpers.html.HTML import textarea [as 别名]
def textarea(name, content="", id=NotGiven, **attrs):
    """Create a text input area.

    Example::

        >>> textarea("body", "", cols=25, rows=10)
        literal(%(u)s'<textarea cols="25" id="body" name="body" rows="10"></textarea>')

    """
    attrs["name"] = name
    _set_id_attr(attrs, id, name)
    return HTML.textarea(content, **attrs)
开发者ID:gjhiggins,项目名称:WebHelpers2,代码行数:14,代码来源:tags.py

示例3: input_area

# 需要导入模块: from webhelpers.html import HTML [as 别名]
# 或者: from webhelpers.html.HTML import textarea [as 别名]
def input_area(name, title, value='', cols='50', rows='5', help_text=None, disabled=False, **kwargs):
    expl = None
    if help_text is not None:
        expl = HTML.span(class_='helpText', c=help_text)
    if disabled:
        kwargs['disabled'] = 'disabled'
    kwargs.setdefault('id', name)

    return HTML.div(class_='formField',
                    id='%s-field' % kwargs['id'],
                    c=[HTML.label(for_=name, c=[
                    HTML.span(class_='labelText', c=[title]),
                    HTML.span(class_='textField', c=[
                        HTML.textarea(name_=name, cols=cols, rows=rows, c=[value], **kwargs),
                        ])]),
                    HTML.literal('<form:error name="%s" />' % name),
                    expl])
开发者ID:nous-consulting,项目名称:ututi,代码行数:19,代码来源:helpers.py

示例4: input_wysiwyg

# 需要导入模块: from webhelpers.html import HTML [as 别名]
# 或者: from webhelpers.html.HTML import textarea [as 别名]
def input_wysiwyg(name, title, value='', cols='60', rows='15'):
    return HTML.div(class_='form-field', c=[
            HTML.label(for_=name, c=[title]),
            HTML.textarea(class_='ckeditor', name_=name, id_=name, cols=cols, rows=rows, c=[value]),
            HTML.literal('<form:error name="%s" />' % name)
            ])
开发者ID:nous-consulting,项目名称:ututi,代码行数:8,代码来源:helpers.py


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