Ticket #5286: 5286.diff
File 5286.diff, 1.2 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: 25 print capfirst(model._meta.verbose_name_plural) 24 26 output.append(MODULE_TEMPLATE % { 25 27 'app': app_label, 26 28 'mod': model._meta.module_name, 27 'name': capfirst(model._meta.verbose_name_plural),29 'name': force_unicode(capfirst(model._meta.verbose_name_plural)), 28 30 'addperm': model._meta.get_add_permission(), 29 31 'changeperm': model._meta.get_change_permission(), 30 32 })