Bugfixing (#27)

* Enforce ordering on some metadata models
* Fix a 500 error while accessing flat pages
* Clean up HTML and fix cards (missing class)
* Make the "driver" app optional and disabled by default
This commit is contained in:
2023-10-10 22:17:21 +02:00
committed by GitHub
parent 448ecae070
commit 87e1107156
9 changed files with 44 additions and 18 deletions

View File

@@ -0,0 +1,20 @@
# Generated by Django 4.2.6 on 2023-10-10 12:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("metadata", "0013_decoderdocument_private"),
]
operations = [
migrations.AlterModelOptions(
name="decoder",
options={"ordering": ["manufacturer", "name"]},
),
migrations.AlterModelOptions(
name="tag",
options={"ordering": ["name"]},
),
]

View File

@@ -95,6 +95,9 @@ class Decoder(models.Model):
upload_to="images/", storage=DeduplicatedStorage, null=True, blank=True
)
class Meta(object):
ordering = ["manufacturer", "name"]
def __str__(self):
return "{0} - {1}".format(self.manufacturer, self.name)
@@ -163,6 +166,9 @@ class Tag(models.Model):
name = models.CharField(max_length=128, unique=True)
slug = models.CharField(max_length=128, unique=True)
class Meta(object):
ordering = ["name"]
def __str__(self):
return self.name