예제 #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))
예제 #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))
예제 #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))
예제 #4
0
파일: uliform.py 프로젝트: iusky/uliweb
 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
         )
     )
예제 #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)
예제 #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)
예제 #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))
예제 #8
0
파일: uliform.py 프로젝트: hankji/uliweb
 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])
예제 #9
0
파일: uliform.py 프로젝트: hankji/uliweb
 def to_html(self, data):
     if data is None:
         return ''
     return u_str(data)
예제 #10
0
파일: uliform.py 프로젝트: uxiexs/uliweb
 def to_html(self, data):
     return '\n'.join([u_str(x) for x in data])
예제 #11
0
 def to_html(self, data):
     return '\n'.join([u_str(x) for x in data])
예제 #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])
예제 #13
0
 def to_html(self, data):
     if data is None:
         return ''
     return u_str(data)
예제 #14
0
파일: uliform.py 프로젝트: victorlv/uliweb
 def to_html(self, data):
     if data is None:
         return ""
     return "\n".join([u_str(x) for x in data])
예제 #15
0
파일: uliform.py 프로젝트: bobgao/uliweb
 def to_html(self, data):
     if data is None:
         return ''
     return '\n'.join([u_str(x) for x in data])