Ticket #5286: 5286.2.diff
File 5286.2.diff, 1.1 KB (added by , 17 years ago) |
---|
-
core/management/commands/adminindex.py
1 1 from django.core.management.base import AppCommand 2 2 from django.utils.text import capfirst 3 from django.utils.encoding import force_unicode 3 4 4 5 MODULE_TEMPLATE = ''' {%% if perms.%(app)s.%(addperm)s or perms.%(app)s.%(changeperm)s %%} 5 6 <tr> … … 21 22 output.append('<div class="module"><h2>%s</h2><table>' % app_label.title()) 22 23 for model in app_models: 23 24 if model._meta.admin: 24 25 output.append(MODULE_TEMPLATE % { 25 26 'app': app_label, 26 27 'mod': model._meta.module_name, 27 'name': capfirst(model._meta.verbose_name_plural),28 'name': force_unicode(capfirst(model._meta.verbose_name_plural)), 28 29 'addperm': model._meta.get_add_permission(), 29 30 'changeperm': model._meta.get_change_permission(), 30 31 })