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))
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))
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 ) )
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)
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)
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))
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])
def to_html(self, data): if data is None: return '' return u_str(data)
def to_html(self, data): return '\n'.join([u_str(x) for x in data])
def to_html(self, data): if data is None: return "" return "\n".join([u_str(x) for x in data])
def to_html(self, data): if data is None: return '' return '\n'.join([u_str(x) for x in data])