Changes between Initial Version and Version 1 of Ticket #15294, comment 41


Ignore:
Timestamp:
Dec 2, 2011, 7:56:11 AM (13 years ago)
Author:
Ramiro Morales

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15294, comment 41

    initial v1  
    22
    33{{{
    4 if True in perms.values():
    5     info = (app_label, model._meta.module_name)
    6     model_dict = {
    7         'name': capfirst(model._meta.verbose_name_plural),
    8         'admin_url': mark_safe('%s/%s/' % (app_label, model.__name__.lower())),
    9         'admin_url': reverse('admin:%s_%s_changelist' % info, current_app=self.name),
    10         'add_url': reverse('admin:%s_%s_add' % info, current_app=self.name),
     4 if True in perms.values():
     5     info = (app_label, model._meta.module_name)
     6     model_dict = {
     7         'name': capfirst(model._meta.verbose_name_plural),
     8-        'admin_url': mark_safe('%s/%s/' % (app_label, model.__name__.lower())),
     9+        'admin_url': reverse('admin:%s_%s_changelist' % info, current_app=self.name),
     10         'add_url': reverse('admin:%s_%s_add' % info, current_app=self.name),
    1111}}}
    1212If the add or change permission is false, why bother resolving the url. Perhaps only include the 'add_url' when the 'add' permission exists?
Back to Top