mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 05:07:50 +02:00
Add more information in consist_item rows
This commit is contained in:
@@ -30,6 +30,8 @@ class ConsistItemInline(SortableInlineAdminMixin, admin.TabularInline):
|
||||
"preview",
|
||||
"published",
|
||||
"scale",
|
||||
"manufacturer",
|
||||
"item_number",
|
||||
"company",
|
||||
"type",
|
||||
"era",
|
||||
|
@@ -2,6 +2,7 @@ import os
|
||||
|
||||
from django.db import models
|
||||
from django.urls import reverse
|
||||
from django.utils.text import Truncator
|
||||
from django.dispatch import receiver
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
@@ -107,13 +108,21 @@ class ConsistItem(models.Model):
|
||||
def preview(self):
|
||||
return self.rolling_stock.image.first().image_thumbnail(100)
|
||||
|
||||
@property
|
||||
def manufacturer(self):
|
||||
return Truncator(self.rolling_stock.manufacturer).chars(10)
|
||||
|
||||
@property
|
||||
def item_number(self):
|
||||
return self.rolling_stock.item_number
|
||||
|
||||
@property
|
||||
def scale(self):
|
||||
return self.rolling_stock.scale
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
return self.rolling_stock.rolling_class.type
|
||||
return self.rolling_stock.rolling_class.type.type
|
||||
|
||||
@property
|
||||
def address(self):
|
||||
|
Reference in New Issue
Block a user