Example #1
0
    def get_display(my):

        top = my.top

        sobjects = my.sobjects
        sobject = my.get_current_sobject()
        index = my.get_current_index()


        column = my.get_option("column")
        sobject = my.get_current_sobject()
        sobj_value = sobject.get_value(column)
        if sobj_value:
            my.total += sobj_value


        format_str = my.get_option('format')
        if format_str:
            format = FormatValue()
            #display = format.get_format_value(value, "$#,###.##")
            display = format.get_format_value(my.total, format_str)
        else:
            display = my.total


        value_div = DivWdg()
        top.add(value_div)
        value_div.add_style("float: right")
        value_div.add(display)

        name = my.get_name()
        sobject.set_value(name, my.total)
        #sobject.commit()

        return top
Example #2
0
    def get_text_value(self):
        '''for csv export'''
        self.sobject = self.get_current_sobject()

        #self.init_kwargs()
        if not self.expression and not self.alt_expression: 
            return super(ExpressionElementWdg, self).get_display()

        if self.alt_expression:
            result = self._get_result(self.sobject, self.alt_expression)
        else:
            result = self._get_result(self.sobject, self.expression)


        if isinstance(result, list):
            delimiter = ','
            result = delimiter.join(result)



        format_str = self.kwargs.get("display_format")
        if format_str:
            format_val = FormatValue()
            format_value = format_val.get_format_value( result, format_str )
            result = format_value

        name = self.get_name()
        self.sobject.set_value(name, result)
        return result
Example #3
0
    def get_display(self):

        top = DivWdg()

        format_str = self.kwargs.get('format')
        value = self.kwargs.get('value')


        format = FormatValue()
        display_value = format.get_format_value( value, format_str )

        widget = self.get_format_wdg(value, format_str, display_value)
        top.add(widget)

        return top
Example #4
0
    def get_text_value(my):
        """for csv export"""
        my.sobject = my.get_current_sobject()

        my.init_kwargs()
        if not my.expression and not my.alt_expression:
            return super(ExpressionElementWdg, my).get_display()

        if my.alt_expression:
            result = my._get_result(my.sobject, my.alt_expression)
        else:
            result = my._get_result(my.sobject, my.expression)

        format_str = my.kwargs.get("display_format")
        if format_str:
            format_val = FormatValue()
            format_value = format_val.get_format_value(result, format_str)
            result = format_value
        return result