本文整理汇总了Python中uliweb.core.html.u_str函数的典型用法代码示例。如果您正苦于以下问题:Python u_str函数的具体用法?Python u_str怎么用?Python u_str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了u_str函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: html
def html(self, data='', py=True):
if data is None:
value = ''
else:
value = '\n'.join([u_str(x) for x in data])
#add convert '&' to '&' 2011-8-20 by limodou
if self.convert_html:
value = value.replace('&', '&')
return str(self.build(value, id='field_'+self.name, name=self.name, rows=self.rows, cols=self.cols, **self.html_attrs))
示例2: html
def html(self, data="", py=True):
if data is None:
value = ""
else:
value = "\n".join([u_str(x) for x in data])
# add convert '&' to '&' 2011-8-20 by limodou
if self.convert_html:
value = value.replace("&", "&")
return str(
self.build(
value, id="field_" + self.name, name=self.name, rows=self.rows, cols=self.cols, **self.html_attrs
)
)
示例3: do_td_field
def do_td_field(self, indent, value, **kwargs):
field_name = kwargs.pop('name', None)
field = getattr(self.form, field_name)
obj = self.form.fields[field_name]
if 'label' in kwargs:
label = kwargs.pop('label')
else:
label = obj.label
if label:
obj.label = label
label_text = obj.get_label(_class='field')
else:
label_text = ''
display = field.data or ' '
if 'width' not in kwargs:
kwargs['width'] = 200
td = begin_tag('td', **kwargs) + u_str(display) + end_tag('td')
return indent * ' ' + '<th align=right width=200>%s</th>%s' % (label_text, td)
示例4: do_static
def do_static(self, indent, value, **kwargs):
field_name = kwargs.get('name', None)
field = getattr(self.form, field_name)
label = kwargs.get('label', None)
obj = self.form.fields[field_name]
if label:
obj.label = label
label = obj.get_label(_class='field')
display = field.data or ' '
return indent * ' ' + '<div class="view"><label>%s:</label><span class="value">%s</span></div>' % (label, u_str(display))
示例5: to_html
def to_html(self, data):
return '\n'.join([u_str(x) for x in data])
示例6: to_html
def to_html(self, data):
if data is None:
return ""
return "\n".join([u_str(x) for x in data])
示例7: to_html
def to_html(self, data):
if data is None:
return ''
return '\n'.join([u_str(x) for x in data])