Ticket #5286: 5286.diff

File 5286.diff, 1.2 KB (added by Alexander Solovyov, 17 years ago)

force_unicode applied

  • core/management/commands/adminindex.py

     
    11from django.core.management.base import AppCommand
    22from django.utils.text import capfirst
     3from django.utils.encoding import force_unicode
    34
    45MODULE_TEMPLATE = '''    {%% if perms.%(app)s.%(addperm)s or perms.%(app)s.%(changeperm)s %%}
    56    <tr>
     
    2122        output.append('<div class="module"><h2>%s</h2><table>' % app_label.title())
    2223        for model in app_models:
    2324            if model._meta.admin:
     25                print capfirst(model._meta.verbose_name_plural)
    2426                output.append(MODULE_TEMPLATE % {
    2527                    'app': app_label,
    2628                    'mod': model._meta.module_name,
    27                     'name': capfirst(model._meta.verbose_name_plural),
     29                    'name': force_unicode(capfirst(model._meta.verbose_name_plural)),
    2830                    'addperm': model._meta.get_add_permission(),
    2931                    'changeperm': model._meta.get_change_permission(),
    3032                })
Back to Top