This commit is contained in:
Mikan
2024-09-20 19:11:22 +03:00
parent 92b9bf8085
commit af2b062cc9

View File

@@ -60,7 +60,12 @@ class ItemData(models.Model):
verbose_name_plural = 'Информационные объекты'
def __str__(self):
return f'{self.collection.verbose} "{self.title}" ({self.author.username})'
author = ""
if self.author:
author = f" ({self.author.username})"
else:
author = " (Archive)"
return f'{self.collection.verbose} "{self.title}"{author}'
@property
def dict(self) -> typing.Dict[str, typing.Union[str, int, float, None]]: