@classmethod
    def from_queryset(cls, queryset, fields=None):
        if fields is None:
            fields = queryset.model._meta.writable_fields
        else:
            fields = [queryset.model._meta.get_field(f) for f in fields]
        table = cls(*(f.name for f in fields))
        for instance in queryset:
            values = []
            for f in fields:
                try:
                    fn = getattr(instance, 'get_{}_display'.format(f.name))
                except __HOLE__:
                    value = f.dumps(getattr(instance, f.attname))
                else:
                    value = fn()
                values.append(value)
            table.add_row(*values)
        return table
dataset/ETHPy150Open natano/tiget/tiget/table.py/Table.from_queryset