mirror of
https://github.com/daniviga/django-ram.git
synced 2025-08-04 13:17:50 +02:00
Gauge vs track
This commit is contained in:
@@ -27,8 +27,8 @@ class DecoderAdmin(admin.ModelAdmin):
|
||||
|
||||
@admin.register(Scale)
|
||||
class ScaleAdmin(admin.ModelAdmin):
|
||||
list_display = ("scale", "ratio", "gauge")
|
||||
list_filter = ("ratio", "gauge")
|
||||
list_display = ("scale", "ratio", "gauge", "track")
|
||||
list_filter = ("ratio", "gauge", "track")
|
||||
search_fields = list_display
|
||||
|
||||
|
||||
|
18
ram/metadata/migrations/0005_rename_gauge_scale_track.py
Normal file
18
ram/metadata/migrations/0005_rename_gauge_scale_track.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.0.6 on 2022-07-18 21:40
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('metadata', '0004_alter_rollingstocktype_options_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='scale',
|
||||
old_name='gauge',
|
||||
new_name='track',
|
||||
),
|
||||
]
|
18
ram/metadata/migrations/0006_scale_gauge.py
Normal file
18
ram/metadata/migrations/0006_scale_gauge.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.0.6 on 2022-07-18 21:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('metadata', '0005_rename_gauge_scale_track'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='scale',
|
||||
name='gauge',
|
||||
field=models.CharField(blank=True, max_length=16),
|
||||
),
|
||||
]
|
@@ -85,6 +85,7 @@ class Scale(models.Model):
|
||||
scale = models.CharField(max_length=32, unique=True)
|
||||
ratio = models.CharField(max_length=16, blank=True)
|
||||
gauge = models.CharField(max_length=16, blank=True)
|
||||
track = models.CharField(max_length=16, blank=True)
|
||||
|
||||
class Meta:
|
||||
ordering = ["scale"]
|
||||
|
@@ -5,8 +5,8 @@
|
||||
<h1 class="fw-light">{{ consist }}</h1>
|
||||
{% if consist.tags.all %}
|
||||
<p><small>Tags:</small>
|
||||
{% for t in consist.tags.all %}<span class="badge bg-primary">
|
||||
{{ t.name }}</span>{# new line is required #}
|
||||
{% for t in consist.tags.all %}<a href="{% url 'filtered' _filter="tag" search=t.slug %}" class="badge rounded-pill bg-primary">
|
||||
{{ t.name }}</a>{# new line is required #}
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
@@ -25,8 +25,8 @@
|
||||
</p>
|
||||
{% if r.rolling_stock.tags.all %}
|
||||
<p class="card-text"><small>Tags:</small>
|
||||
{% for t in r.rolling_stock.tags.all %}<span class="badge bg-primary">
|
||||
{{ t.name }}</span>{# new line is required #}
|
||||
{% for t in r.rolling_stock.tags.all %}<a href="{% url 'filtered' _filter="tag" search=t.slug %}" class="badge rounded-pill bg-primary">
|
||||
{{ t.name }}</a>{# new line is required #}
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
from ram.utils import git_suffix
|
||||
|
||||
__version__ = "0.0.8"
|
||||
__version__ = "0.0.9"
|
||||
__version__ += git_suffix(__file__)
|
||||
|
Reference in New Issue
Block a user