Exemplo n.º 1
0
 class CountryTable(tables.MemoryTable):
     name = tables.TextColumn()
     capital = tables.TextColumn()
     population = tables.NumberColumn(verbose_name="Population Size")
     currency = tables.NumberColumn(visible=False, inaccessible=True)
     tld = tables.TextColumn(visible=False, verbose_name="Domain")
     calling_code = tables.NumberColumn(name="cc", verbose_name="Phone Ext.")
Exemplo n.º 2
0
    class CountryTable(tables.MemoryTable):
        name = tables.TextColumn()
        capital = tables.TextColumn()
        population = tables.NumberColumn(verbose_name="Population Size")
        currency = tables.NumberColumn(visible=False, inaccessible=True)
        tld = tables.TextColumn(visible=False, verbose_name="Domain")
        cc = tables.NumberColumn(model_rel="calling_code",
                                 verbose_name="Phone Ext.")

        def render_cc(self, src_row):
            return "SUCCESS"

        def render_calling_code(self, src_row):
            # We should never get here
            assert False