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

Add kind field to JournalEntry

This commit is contained in:
Jeremy Stretch
2021-03-17 12:51:39 -04:00
parent bd95d2b852
commit 82fbd975f1
8 changed files with 60 additions and 5 deletions

View File

@@ -399,6 +399,11 @@ class JournalEntry(BigIDModel):
blank=True,
null=True
)
kind = models.CharField(
max_length=30,
choices=JournalEntryKindChoices,
default=JournalEntryKindChoices.KIND_INFO
)
comments = models.TextField()
objects = RestrictedQuerySet.as_manager()
@@ -408,7 +413,10 @@ class JournalEntry(BigIDModel):
verbose_name_plural = 'journal entries'
def __str__(self):
return f"{self.created}"
return f"{self.created} - {self.get_kind_display()}"
def get_kind_class(self):
return JournalEntryKindChoices.CSS_CLASSES.get(self.kind)
#