Merge pull request 'Admin strxfrm mac' (!81) from strxfrm_pro_mac into master
Reviewed-on: #81
This commit is contained in:
commit
9a11491dcc
1 changed files with 8 additions and 2 deletions
|
@ -7,6 +7,7 @@ import locale
|
|||
from django.contrib import admin
|
||||
from django.contrib.admin import AdminSite
|
||||
from django.contrib.flatpages.models import FlatPage
|
||||
import logging
|
||||
|
||||
# Note: we are renaming the original Admin and Form as we import them!
|
||||
from django.contrib.flatpages.admin import FlatPageAdmin as FlatPageAdminOld
|
||||
|
@ -56,8 +57,13 @@ def get_app_list(self, request, app_label=None):
|
|||
|
||||
|
||||
# Sort the models alphabetically within each app.
|
||||
try: # na macu nefunguje locale.strxfrm :-/ proto je tu try except block
|
||||
for app in app_list:
|
||||
app['models'].sort(key=lambda x: locale.strxfrm(x['name'].lower()))
|
||||
except OSError as e:
|
||||
# locale.strxfrm nefunguje na macu... :-/ -> neprovede se řazení
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.error(e)
|
||||
|
||||
return app_list
|
||||
|
||||
|
|
Loading…
Reference in a new issue