Speedup inlines using autocomplete field and add more previews (#38)

This commit is contained in:
2024-11-04 11:33:28 +01:00
committed by GitHub
parent 456272b93a
commit d0854a4cff
8 changed files with 21 additions and 8 deletions

View File

@@ -60,6 +60,9 @@ class ConsistItem(models.Model):
def __str__(self):
return "{0}".format(self.rolling_stock)
def preview(self):
return self.rolling_stock.image.first().image_thumbnail(100)
def type(self):
return self.rolling_stock.rolling_class.type