mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* Initial work on #13381 * Fix backend type display in table column * Fix data source type choices during bulk edit * Misc cleanup * Move backend utils from core app to netbox * Move backend type validation from serializer to model
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
|