WebFaction
Community site: login faq

It seems to be a simple enough question: I want my querysets ordered in the correct way with respect to my locale—e.g "ö" comes last in the alphabet, not after "o", as the results are in swedish.

A good hour of Googling doesn't give me much apart from: a) Django does not have support for injecting collation parameters into queries, but there is a feature request for it b) You can change the default collation for a cluster in Postgres, which I guess is not an option on shared hosting.

Are there other ways to do it? Options to the connection string?

asked 26 Mar '14, 08:58

thatemil
724
accept rate: 0%


There are few ways you could do this.

  • You could open a support ticket to have a new database created manually with the collation option that you need.
  • You could write a custom DB backend for Django that adds the COLLATE option to your queries.
  • You could write all of your queries with raw SQL, and include the COLLATE option there.

Hope that helps!

permanent link

answered 26 Mar '14, 19:32

seanf
12.2k41836
accept rate: 37%

Thanks, Sean. I'll open up a ticket as the rest of the options seem like waaaaay more work. :-)

(28 Mar '14, 07:51) thatemil
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×109
×22
×5
×1

question asked: 26 Mar '14, 08:58

question was seen: 3,564 times

last updated: 28 Mar '14, 07:51

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM