Skip to content

Commit

Permalink
fix: set collation based on database engine
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Nov 21, 2023
1 parent f205bfe commit aed7e17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apis_ontology/querysets.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.db.models.functions import Collate
from django.conf import settings

from .models import Person

DB_COLLATION = 'binary' if 'sqlite' in settings.DATABASES['default']['ENGINE'] else 'en-x-icu'

PersonListViewQueryset = Person.objects.all().order_by(Collate("name", "en-x-icu"))
PersonListViewQueryset = Person.objects.all().order_by(Collate("name", DB_COLLATION))

0 comments on commit aed7e17

Please sign in to comment.