Example #1
0
 def render_body(self, value = None, engine = '', translate = unicode):
     """
     A method to render field and return rendered string
     """
     context = {}
     context['args'] = self.expand_args(except_value = True)
     context['values'] = self.values
     context['value'] = value or self.default
     return templatehandler.render(context, self.enginename, tid = self.FLID)
Example #2
0
 def render_body(self, value = None, engine = '', translate = unicode):
     """
     A method to render field and return rendered string
     """
     context = {}
     context['args'] = self.expand_args(except_value = True)
     if value:
         context['value'] = value
     else:
         context['value'] = ''
     tbody = self.FIELD_TEMPLATE
     return templatehandler.render(context, self.enginename, tid = self.FLID)
Example #3
0
 def render_body(self, value = None, engine = '', translate = unicode):
     """
     A method to render field and return rendered string
     """
 
     context = {}
     context['args'] = self.expand_args(except_value = True, except_name = True)
     context['values'] = [(x, unicode(y)) for x, y in self.values]
     if value:
         context['value'] = [unicode(x) for x in value]
     else:
         context['value'] = []
     context['name'] = self.name
     context['vertical'] = self.vertical
     return templatehandler.render(context, self.enginename, tid = self.FLID)
Example #4
0
    def render_body(self, value = None, engine = '', translate = unicode):
        """
        A method to render field and return rendered string
        """
        context = {}
        context['args'] = self.expand_args(except_value = True)
        context['title'] = self.title
        context['TYPE'] = self.TYPE
        if value is None:
            context['disable'] = ''
        else:
            a = {'name':self.REPLACE_PREFIX+self.name,
                }
            astr = ''
            for k in a:
                astr+= keyvalue2str(k, a[k])
            t = '<input type = "checkbox" %s />replace\n'
            context['disable'] = t % astr

        return self.FIELD_TEMPLATE % context
        return templatehandler.render(context, self.enginename, tid = self.FLID)
Example #5
0
    def render_body(self, value = None, engine = '', translate = unicode):
        """
        A method to render field and return rendered string
        """
        context = {}
        context['args'] = self.expand_args(except_value = True)
        context['title'] = self.title
        context['TYPE'] = self.TYPE
        if value is None:
            context['cbargs'] = 'disabled'
        else:
            a = {'name':self.ERASE_PREFIX+self.name,
                }
            astr = ''
            for k in a:
                astr+= keyvalue2str(k, a[k])
            context['cbargs'] = astr
            context['value'] = str(value)
        context['height'] = 48
        tbody = self.FIELD_TEMPLATE

        return templatehandler.render(context, self.enginename, tid = self.FLID)