Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import django_tables2 as tables
- from web_logic.models import Stations
- from django_tables2.utils import A
- class StationTable(tables.Table):
- """
- """
- station_id = tables.LinkColumn()
- rack_sum = tables.LinkColumn("racks_page", args=[A('pk')], verbose_name='Кол-во стоек')
- status = tables.BooleanColumn()
- def __init__(self, *args, **kwargs):
- super(StationTable, self).__init__(*args, **kwargs)
- def render_station_id(self, value):
- print(value)
- return "%s " % value
- class Meta:
- model = Stations
- exclude = (
- "id",
- "onboot_time",
- 'certificat_key',
- 'private_key',
- "status",
- "ipadress",
- 'latitude',
- 'longitude',
- )
- template_name = 'django_tables2/bootstrap.html'
- attrs = {
- "class": "table",
- "td": {"class": "table-hover",},
- "thead": {"class": "table-dark"},
- }
Add Comment
Please, Sign In to add comment