diff --git a/designsafe/apps/workspace/migrations/0012_alter_applistingentry_options_and_more.py b/designsafe/apps/workspace/migrations/0012_alter_applistingentry_options_and_more.py new file mode 100644 index 0000000000..7d35b4be57 --- /dev/null +++ b/designsafe/apps/workspace/migrations/0012_alter_applistingentry_options_and_more.py @@ -0,0 +1,37 @@ +# Generated by Django 4.2.11 on 2024-04-29 19:23 + +from django.db import migrations +import django.db.models.functions.comparison +import django.db.models.functions.text + + +class Migration(migrations.Migration): + dependencies = [ + ("workspace", "0011_alter_applistingentry_options"), + ] + + operations = [ + migrations.AlterModelOptions( + name="applistingentry", + options={ + "ordering": [ + "-is_popular", + django.db.models.functions.text.Lower("label"), + ], + "verbose_name_plural": "App Listing Entries", + }, + ), + migrations.AlterModelOptions( + name="appvariant", + options={ + "ordering": [ + "priority", + django.db.models.functions.text.Lower( + django.db.models.functions.comparison.Coalesce( + "label", "app_id" + ) + ), + ] + }, + ), + ] diff --git a/designsafe/apps/workspace/models/app_entries.py b/designsafe/apps/workspace/models/app_entries.py index e0bdfbd47c..0e15c02051 100644 --- a/designsafe/apps/workspace/models/app_entries.py +++ b/designsafe/apps/workspace/models/app_entries.py @@ -2,7 +2,7 @@ """ from django.db import models -from django.db.models.functions import Coalesce +from django.db.models.functions import Coalesce, Lower APP_ICONS = [ ("Generic-App", "Generic: Application"), @@ -147,7 +147,7 @@ class Meta: ) ] - ordering = ["-is_popular", "label"] + ordering = ["-is_popular", Lower("label")] class AppVariant(models.Model): @@ -232,4 +232,4 @@ class Meta: ) ] - ordering = ["priority", Coalesce("label", "app_id")] + ordering = ["priority", Lower(Coalesce("label", "app_id"))]