mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
21 lines
394 B
Python
21 lines
394 B
Python
![]() |
import django_tables2 as tables
|
||
|
|
||
|
from netbox.registry import registry
|
||
|
|
||
|
__all__ = (
|
||
|
'BackendTypeColumn',
|
||
|
)
|
||
|
|
||
|
|
||
|
class BackendTypeColumn(tables.Column):
|
||
|
"""
|
||
|
Display a data backend type.
|
||
|
"""
|
||
|
def render(self, value):
|
||
|
if backend := registry['data_backends'].get(value):
|
||
|
return backend.label
|
||
|
return value
|
||
|
|
||
|
def value(self, value):
|
||
|
return value
|