Ticket #3817: admin_modify.2.diff
File admin_modify.2.diff, 2.0 KB (added by , 18 years ago) |
---|
-
django/contrib/admin/templatetags/admin_modify.py
38 38 opts = context['opts'] 39 39 change = context['change'] 40 40 is_popup = context['is_popup'] 41 has_add_permission = context.has_key('has_add_permission') and context['has_add_permission'] or False 41 42 return { 42 43 'onclick_attrib': (opts.get_ordered_objects() and change 43 44 and 'onclick="submitOrderForm();"' or ''), 44 45 'show_delete_link': (not is_popup and context['has_delete_permission'] 45 46 and (change or context['show_delete'])), 46 47 'show_save_as_new': not is_popup and change and opts.admin.save_as, 47 'show_save_and_add_another': not is_popup and (not opts.admin.save_as or context['add']) ,48 'show_save_and_add_another': not is_popup and (not opts.admin.save_as or context['add']) and has_add_permission, 48 49 'show_save_and_continue': not is_popup and context['has_change_permission'], 49 50 'show_save': True 50 51 } 51 52 submit_row = register.inclusion_tag('admin/submit_line.html', takes_context=True)(submit_row) -
django/contrib/admin/views/main.py
201 201 'change': change, 202 202 'has_delete_permission': context['perms'][app_label][opts.get_delete_permission()], 203 203 'has_change_permission': context['perms'][app_label][opts.get_change_permission()], 204 'has_add_permission': context['perms'][app_label][opts.get_add_permission()], 204 205 'has_file_field': opts.has_field_type(models.FileField), 205 206 'has_absolute_url': hasattr(model, 'get_absolute_url'), 206 207 'auto_populated_fields': auto_populated_fields,