Did I find the right examples for you? yes no

All Samples(6)  |  Call(5)  |  Derive(0)  |  Import(1)

src/l/o/logistics-HEAD/logistics_project/apps/ilsgateway/tables.py   logistics(Download)
 
from djtables import Table, Column
from models import ILSGatewayColumn, ILSGatewayDateColumn, Product
from djtables.column import DateColumn
from django.core.urlresolvers import reverse
class CurrentStockStatusTable(Table):
    msd_code = ILSGatewayColumn(head_verbose="MSD Code")
    delivery_group = Column()
    name = Column(link=lambda cell: reverse("ilsgateway.views.facilities_detail", args=[cell.row.pk]))
    for product in Product.objects.all():
        exec("%s = ILSGatewayColumn(name='%s', value=_get_stock_value, head_verbose='%s', sortable=False)" % (product.sms_code, product.sms_code, product.name))
 
class CurrentMOSTable(Table):
    msd_code = ILSGatewayColumn(head_verbose="MSD Code")
class OrderingTable(Table):
    msd_code = ILSGatewayColumn(head_verbose="MSD Code")
    delivery_group = Column()
    name = Column(link=lambda cell: reverse("ilsgateway.views.facilities_detail", args=[cell.row.pk]))
    randr_status = ILSGatewayColumn(head_verbose="R&R Status", value=_get_latest_randr_status, sortable=False)