Beispiel #1
0
def all_agg_radiobox(any_=False, prefix="", name='radio'):
    out = []
    
    #grab from global scope so we can add to it
    fields = list(GRAPH_FIELDS)
    
    if any_:
        fields += ['any']
    
    for field in fields:
        if field == 'any':
            sel='checked="checked"'
        else:
            sel = ""
            
        out.append(
        """<input %(sel)s type="radio" id="r_%(field)s" name="%(name)s">
           <label for="r_%(field)s">%(display)s</label>""" %
                {'name': name,
                 'sel': sel,
                 'field': field,
                 'display': FIELD_TITLES[field]}
        )
    
    return html_table(out, 5, "radiotable")
Beispiel #2
0
def all_agg_radiobox(any_=False, prefix="", name='radio'):
    out = []

    #grab from global scope so we can add to it
    fields = list(GRAPH_FIELDS)

    if any_:
        fields += ['any']

    for field in fields:
        if field == 'any':
            sel = 'checked="checked"'
        else:
            sel = ""

        out.append(
            """<input %(sel)s type="radio" id="r_%(field)s" name="%(name)s">
           <label for="r_%(field)s">%(display)s</label>""" % {
                'name': name,
                'sel': sel,
                'field': field,
                'display': FIELD_TITLES[field]
            })

    return html_table(out, 5, "radiotable")
Beispiel #3
0
def render_table(self):  #will be attached to the class in the function
    from main.table import html_table
    out=[]
    for field in FILTER_FIELDS:
        num_field = str(self[field])
        op = str(self[field + "_op"])
        title = getattr(self, 'fields')[field].label
        out.append( title + op + num_field )

    return html_table(out, 3)
Beispiel #4
0
def render_table(self):  #will be attached to the class in the function
    from main.table import html_table
    out = []
    for field in FILTER_FIELDS:
        num_field = str(self[field])
        op = str(self[field + "_op"])
        title = getattr(self, 'fields')[field].label
        out.append(title + op + num_field)

    return html_table(out, 3)
Beispiel #5
0
def all_agg_checkbox(prefix=""):
    out = []
    for field in GRAPH_FIELDS:
        if field == 'total' or field == 'pic':
            sel='checked="checked"'
        else:
            sel = ""
        
        out.append(
        """<input %(sel)s type="checkbox" id="c_%(field)s">
           <label for="c_%(field)s">%(display)s</label>""" %
                {'sel': sel, 'field': field, 'display': FIELD_TITLES[field]}
        )
    
    return html_table(out, 5, "checktable")
Beispiel #6
0
def all_agg_checkbox(prefix=""):
    out = []
    for field in GRAPH_FIELDS:
        if field == 'total' or field == 'pic':
            sel = 'checked="checked"'
        else:
            sel = ""

        out.append("""<input %(sel)s type="checkbox" id="c_%(field)s">
           <label for="c_%(field)s">%(display)s</label>""" % {
            'sel': sel,
            'field': field,
            'display': FIELD_TITLES[field]
        })

    return html_table(out, 5, "checktable")