I have a simple Django app with a Postgresql database. The database is configured with nn_NO.UTF-8 locale.
mything=>\l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+----------+----------+-------------+-------------+----------------------- mything | postgres | UTF8 | nn_NO.UTF-8 | nn_NO.UTF-8 | =Tc/postgres + | | | | | postgres=CTc/postgres+ | | | | | me=CTc/postgres
Let's say there's a table MyTable
.
I want MyTable.objects.order_by('name')
to sort according to en_US rules, not nn_NO. Is it possible to override the sorting locale from Python/Django, or do I have to recreate the entire database?
settings.py contains
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True