Ticket #1083: admin.diff
File admin.diff, 2.3 KB (added by , 19 years ago) |
---|
-
django/contrib/admin/templatetags/admin_list.py
82 82 if field_name == '__repr__': 83 83 header = lookup_opts.verbose_name 84 84 else: 85 func = getattr(cl.mod .Klass, field_name) # Let AttributeErrors propogate.85 func = getattr(cl.model, field_name) # Let AttributeErrors propogate. 86 86 try: 87 87 header = func.short_description 88 88 except AttributeError: -
django/contrib/admin/views/main.py
559 559 if not request.user.has_perm(app_label + '.' + opts.get_change_permission()): 560 560 raise PermissionDenied 561 561 if request.POST and request.POST.has_key("_saveasnew"): 562 return add_stage(request, path, form_url='../ add/')562 return add_stage(request, path, form_url='../../add/') 563 563 try: 564 564 manipulator_class = model.ChangeManipulator 565 565 manipulator = manipulator_class(object_id) … … 587 587 return HttpResponseRedirect(request.path) 588 588 elif request.POST.has_key("_saveasnew"): 589 589 request.user.add_message(_('The %(name)s "%(obj)s" was added successfully. You may edit it again below.') % {'name': opts.verbose_name, 'obj': new_object}) 590 return HttpResponseRedirect("../ %s/" % pk_value)590 return HttpResponseRedirect("../../%s/" % pk_value) 591 591 elif request.POST.has_key("_addanother"): 592 592 request.user.add_message(msg + ' ' + (_("You may add another %s below.") % opts.verbose_name)) 593 return HttpResponseRedirect("../ add/")593 return HttpResponseRedirect("../../add/") 594 594 else: 595 595 request.user.add_message(msg) 596 return HttpResponseRedirect("../ ")596 return HttpResponseRedirect("../../") 597 597 else: 598 598 # Populate new_data with a "flattened" version of the current data. 599 599 new_data = manipulator.flatten_data()