Skip to content

Commit

Permalink
fixex ProjectAdmin search collation
Browse files Browse the repository at this point in the history
  • Loading branch information
saxix committed Oct 22, 2024
1 parent 3ed2ace commit d6468a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/aurora/core/admin/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.core.cache import caches

from adminfilters.mixin import AdminAutoCompleteSearchMixin
from django.db.models.functions import Collate
from mptt.admin import MPTTModelAdmin
from smart_admin.mixins import LinkedObjectsMixin

Expand All @@ -27,7 +28,9 @@ class ProjectAdmin(SyncMixin, AdminAutoCompleteSearchMixin, LinkedObjectsMixin,
autocomplete_fields = "parent, "

def get_queryset(self, request):
return super().get_queryset(request).select_related("organization")
return super().get_queryset(request).annotate(
name_deterministic=Collate("name", "und-x-icu"),
).select_related("organization")

#
# def get_search_results(self, request, queryset, search_term):
Expand Down

0 comments on commit d6468a9

Please sign in to comment.