diff --git a/netbox/dcim/tables/modules.py b/netbox/dcim/tables/modules.py index 78615ed71..52edea8b4 100644 --- a/netbox/dcim/tables/modules.py +++ b/netbox/dcim/tables/modules.py @@ -3,7 +3,7 @@ import django_tables2 as tables from dcim.models import Module, ModuleType, ModuleTypeProfile from netbox.tables import NetBoxTable, columns -from .template_code import WEIGHT +from .template_code import MODULETYPEPROFILE_ATTRIBUTES, WEIGHT __all__ = ( 'ModuleTable', @@ -17,6 +17,12 @@ class ModuleTypeProfileTable(NetBoxTable): verbose_name=_('Name'), linkify=True ) + attributes = columns.TemplateColumn( + template_code=MODULETYPEPROFILE_ATTRIBUTES, + accessor=tables.A('schema__properties'), + orderable=False, + verbose_name=_('Attributes') + ) comments = columns.MarkdownColumn( verbose_name=_('Comments'), ) @@ -30,7 +36,7 @@ class ModuleTypeProfileTable(NetBoxTable): 'pk', 'id', 'name', 'description', 'comments', 'tags', 'created', 'last_updated', ) default_columns = ( - 'pk', 'name', 'description', + 'pk', 'name', 'description', 'attributes', ) diff --git a/netbox/dcim/tables/template_code.py b/netbox/dcim/tables/template_code.py index 225237ec4..3c4ca7bd4 100644 --- a/netbox/dcim/tables/template_code.py +++ b/netbox/dcim/tables/template_code.py @@ -568,3 +568,7 @@ MODULEBAY_BUTTONS = """ {% endif %} {% endif %} """ + +MODULETYPEPROFILE_ATTRIBUTES = """ +{% if value %}{% for attr in value %}{{ attr }}{% if not forloop.last %}, {% endif %}{% endfor %}{% endif %} +"""