Exemplo n.º 1
0
 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))
Exemplo n.º 2
0
 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))
Exemplo n.º 3
0
    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))
Exemplo n.º 4
0
 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 '&amp;' 2011-8-20 by limodou
     if self.convert_html:
         value = value.replace("&", "&amp;")
     return str(
         self.build(
             value, id="field_" + self.name, name=self.name, rows=self.rows, cols=self.cols, **self.html_attrs
         )
     )
Exemplo n.º 5
0
 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 '&nbsp;'
     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)
Exemplo n.º 6
0
    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 '&nbsp;'
        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)
Exemplo n.º 7
0
 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 '&nbsp;'
     return indent * ' ' + '<div class="view"><label>%s:</label><span class="value">%s</span></div>' % (label, u_str(display))
Exemplo n.º 8
0
 def to_html(self, data):
     if issubclass(self.build, TextArea):
         return '\n'.join([u_str(x) for x in data])
     else:
         return self.delimeter.join([u_str(x) for x in data])
Exemplo n.º 9
0
 def to_html(self, data):
     if data is None:
         return ''
     return u_str(data)
Exemplo n.º 10
0
 def to_html(self, data):
     return '\n'.join([u_str(x) for x in data])
Exemplo n.º 11
0
 def to_html(self, data):
     return '\n'.join([u_str(x) for x in data])
Exemplo n.º 12
0
 def to_html(self, data):
     if issubclass(self.build, TextArea):
         return '\n'.join([u_str(x) for x in data])
     else:
         return self.delimeter.join([u_str(x) for x in data])
Exemplo n.º 13
0
 def to_html(self, data):
     if data is None:
         return ''
     return u_str(data)
Exemplo n.º 14
0
 def to_html(self, data):
     if data is None:
         return ""
     return "\n".join([u_str(x) for x in data])
Exemplo n.º 15
0
 def to_html(self, data):
     if data is None:
         return ''
     return '\n'.join([u_str(x) for x in data])