本文整理汇总了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
示例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)
示例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])
示例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)
])