Move decoder interface def into rolling stock

This commit is contained in:
2022-11-01 00:05:47 +01:00
parent 90ffadb2ab
commit 242fe6814d
8 changed files with 80 additions and 12 deletions

View File

@@ -20,8 +20,8 @@ class PropertyAdmin(admin.ModelAdmin):
@admin.register(Decoder)
class DecoderAdmin(admin.ModelAdmin):
readonly_fields = ("image_thumbnail",)
list_display = ("__str__", "interface")
list_filter = ("manufacturer", "interface")
list_display = ("__str__", "sound")
list_filter = ("manufacturer", "sound")
search_fields = ("name", "manufacturer__name")

View File

@@ -0,0 +1,18 @@
# Generated by Django 4.1.2 on 2022-10-31 23:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("metadata", "0007_rename_track_scale_tracks"),
("roster", "0013_rollingstock_decoder_interface"),
]
operations = [
migrations.RemoveField(
model_name="decoder",
name="interface",
),
]

View File

@@ -66,9 +66,6 @@ class Decoder(models.Model):
limit_choices_to={"category": "model"},
)
version = models.CharField(max_length=64, blank=True)
interface = models.PositiveSmallIntegerField(
choices=settings.DECODER_INTERFACES, null=True, blank=True
)
sound = models.BooleanField(default=False)
image = models.ImageField(upload_to="images/", null=True, blank=True)