Compare commits
5 commits
d67d2f372b
...
9a11491dcc
Author | SHA1 | Date | |
---|---|---|---|
9a11491dcc | |||
a97071cd03 | |||
9c4c60765e | |||
ddd12b684d | |||
eb2b861d48 |
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.
|
||||
for app in app_list:
|
||||
app['models'].sort(key=lambda x: locale.strxfrm(x['name'].lower()))
|
||||
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