1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Add JournalEntry list view w/filtering

This commit is contained in:
Jeremy Stretch
2021-03-16 15:57:23 -04:00
parent 64d11d32c8
commit 8be4fbbce3
9 changed files with 94 additions and 10 deletions

View File

@ -98,7 +98,32 @@ class ObjectChangeTable(BaseTable):
fields = ('time', 'user_name', 'action', 'changed_object_type', 'object_repr', 'request_id')
class JournalEntryTable(BaseTable):
created = tables.DateTimeColumn(
format=settings.SHORT_DATETIME_FORMAT
)
assigned_object_type = tables.Column(
verbose_name='Object type'
)
assigned_object = tables.Column(
linkify=True,
orderable=False,
verbose_name='Object'
)
actions = ButtonsColumn(
model=JournalEntry,
buttons=('edit', 'delete')
)
class Meta(BaseTable.Meta):
model = JournalEntry
fields = ('created', 'created_by', 'assigned_object_type', 'assigned_object', 'comments', 'actions')
class ObjectJournalTable(BaseTable):
"""
Used for displaying a set of JournalEntries within the context of a single object.
"""
created = tables.DateTimeColumn(
format=settings.SHORT_DATETIME_FORMAT
)