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

@@ -120,6 +120,9 @@ class RollingStock(models.Model):
def get_absolute_url(self):
return reverse("rolling_stock", kwargs={"uuid": self.uuid})
def preview(self):
return self.image.first().image_thumbnail(350)
def country(self):
return str(self.rolling_class.company.country)