mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 18:08:38 -06:00
Add combined dimensions column
This commit is contained in:
parent
56557b629f
commit
d7b5fed152
@ -236,6 +236,11 @@ class ImageAttachmentTable(NetBoxTable):
|
|||||||
linkify=lambda record: record.image.url,
|
linkify=lambda record: record.image.url,
|
||||||
orderable=False,
|
orderable=False,
|
||||||
)
|
)
|
||||||
|
dimensions = columns.TemplateColumn(
|
||||||
|
verbose_name=_('Dimensions'),
|
||||||
|
orderable=False,
|
||||||
|
template_code="{{ record.image_width }}×{{ record.image_height }}",
|
||||||
|
)
|
||||||
object_type = columns.ContentTypeColumn(
|
object_type = columns.ContentTypeColumn(
|
||||||
verbose_name=_('Object Type'),
|
verbose_name=_('Object Type'),
|
||||||
)
|
)
|
||||||
@ -254,7 +259,7 @@ class ImageAttachmentTable(NetBoxTable):
|
|||||||
'pk', 'object_type', 'parent', 'image', 'name', 'filename', 'description', 'image_height', 'image_width',
|
'pk', 'object_type', 'parent', 'image', 'name', 'filename', 'description', 'image_height', 'image_width',
|
||||||
'size', 'created', 'last_updated',
|
'size', 'created', 'last_updated',
|
||||||
)
|
)
|
||||||
default_columns = ('image', 'object_type', 'parent', 'description', 'size')
|
default_columns = ('image', 'object_type', 'parent', 'description', 'dimensions', 'size')
|
||||||
|
|
||||||
def render_image(self, record):
|
def render_image(self, record):
|
||||||
return str(record)
|
return str(record)
|
||||||
|
Loading…
Reference in New Issue
Block a user