Modify ↓
Opened 12 years ago
Closed 9 years ago
#10586 closed defect (fixed)
Sorting in unicode
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | normal | Component: | UserManagerPlugin |
Severity: | normal | Keywords: | |
Cc: | Steffen Hoffmann | Trac Release: |
Description
Dear Friends!
I make the diff modification in template.
Now the sorting is made by the name column. But in pt_BR or pt_BR.UTF-8 the accented characters are on the list bottom.
Usuário | Nome | Email | Role ZA\asdqwe | Amanda qwe qwe | amanda@qwe.com.br | Analista de Qualidade TT\qweqwe | Bruno qwe qwe | bruno@qwe.com.br | Analista de Qualidade TJ\qweqwe | Ivan qwe asd | ivan@qwe.com.br | integrador AS\asdasd | Vinicius asd qwe | vmsoares@qwe.com.br | gestor AV\asdqwe | Ítalo qwe zxc | italoantonio@qwe.com.br | integrador <<<
Thx.
--
KlauX
Attachments (1)
Change History (6)
Changed 12 years ago by
Attachment: | admin_um.patch added |
---|
comment:1 Changed 12 years ago by
Cc: | Steffen Hoffmann added; klaux1@… removed |
---|---|
Owner: | changed from Catalin BALAN to Ryan J Ollos |
Status: | new → assigned |
comment:2 Changed 12 years ago by
- Columns can be sorted on the Users page.
- Changes are Python 2.4 compatible by choosing
and
/or
clauses in favor ofif
/else
, but code can be refactored and made cleaner in a future revision when the 2.4 compatibility is dropped. - The implementation of the query module (primarily
query.html
,query_results.html
,query.py
) was used as a guide.
- Changes are Python 2.4 compatible by choosing
- Bumped version to 0.5dev.
- Added a changelog.
comment:3 Changed 12 years ago by
Testing feedback, code review and any other comments are welcome and appreciated.
comment:4 Changed 12 years ago by
comment:5 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
Replying to klaux1@yahoo.com.br:
What Trac version are you running? Do you have Babel installed and the language set?
I prepared a change that I'll commit shortly, which enables sorting for each of the columns. Please let me know if that satisfies your need. I felt it was a more general solution than the patch you proposed.
There is a suggestion here to use
locale.strxfrm()
orlocale.strcoll()
. I tried searching around the Trac core for examples, and I don't see any instances of sorting in the template for a case in which the sort function would need to know the language. In the Trac core, the sorting appears to be handled at the database layer. For example, when sorting a custom report by a column, the sort action results in a database query with theORDER BY
parameter specified. Per my testing, the sorting does happen property when the language has been set in the user preference (I tested with ticket summaries in Russian), so the proper sorting per the locale must be happening in the database backend.It seems we could implement the sorting at the DB layer here as well, but we'd have to modify the API so that
UserManager.get_active_users
andUserManager.search
would take asortby
parameter ... or so it appears to me on initial inspection.