mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Allows to sort non text entries
Part of ticket: IPA should allow internationalized domain names https://fedorahosted.org/freeipa/ticket/3169 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
93ad23912e
commit
47f473d0ca
@ -911,6 +911,9 @@ class Param(ReadOnly):
|
||||
pass
|
||||
return self.default
|
||||
|
||||
def sort_key(self, value):
|
||||
return value
|
||||
|
||||
json_exclude_attrs = (
|
||||
'alwaysask', 'autofill', 'cli_name', 'cli_short_name', 'csv',
|
||||
'sortorder', 'falsehoods', 'truths', 'version',
|
||||
@ -1457,6 +1460,8 @@ class Str(Data):
|
||||
length=self.length,
|
||||
)
|
||||
|
||||
def sort_key(self, value):
|
||||
return value.lower()
|
||||
|
||||
class IA5Str(Str):
|
||||
"""
|
||||
|
@ -1936,7 +1936,8 @@ class LDAPSearch(BaseLDAPCommand, crud.Search):
|
||||
if self.sort_result_entries:
|
||||
if self.obj.primary_key:
|
||||
def sort_key(x):
|
||||
return x[self.obj.primary_key.name][0].lower()
|
||||
return self.obj.primary_key.sort_key(
|
||||
x[self.obj.primary_key.name][0])
|
||||
entries.sort(key=sort_key)
|
||||
|
||||
if not options.get('raw', False):
|
||||
|
Loading…
Reference in New Issue
Block a user