Guest User

Untitled

a guest
Oct 21st, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. import django_tables2 as tables
  2. from web_logic.models import Stations
  3. from django_tables2.utils import A
  4.  
  5.  
  6. class StationTable(tables.Table):
  7. """
  8.  
  9. """
  10.  
  11. station_id = tables.LinkColumn()
  12. rack_sum = tables.LinkColumn("racks_page", args=[A('pk')], verbose_name='Кол-во стоек')
  13. status = tables.BooleanColumn()
  14.  
  15. def __init__(self, *args, **kwargs):
  16. super(StationTable, self).__init__(*args, **kwargs)
  17.  
  18. def render_station_id(self, value):
  19. print(value)
  20. return "%s " % value
  21.  
  22. class Meta:
  23. model = Stations
  24. exclude = (
  25. "id",
  26. "onboot_time",
  27. 'certificat_key',
  28. 'private_key',
  29. "status",
  30. "ipadress",
  31. 'latitude',
  32. 'longitude',
  33. )
  34. template_name = 'django_tables2/bootstrap.html'
  35. attrs = {
  36. "class": "table",
  37. "td": {"class": "table-hover",},
  38. "thead": {"class": "table-dark"},
  39. }
Add Comment
Please, Sign In to add comment