Changeset 8144
- Timestamp:
- 07/29/08 19:52:01 (5 months ago)
- Files:
-
- django/trunk/django/contrib/admin/options.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/admin/options.py
r8136 r8144 348 348 pk_value = new_object._get_pk_val() 349 349 LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(self.model).id, pk_value, force_unicode(new_object), ADDITION) 350 msg = _('The %(name)s "%(obj)s" was added successfully.') % {'name': opts.verbose_name, 'obj': new_object}350 msg = _('The %(name)s "%(obj)s" was added successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': new_object} 351 351 # Here, we distinguish between different save types by checking for 352 352 # the presence of keys in request.POST. … … 362 362 (escape(pk_value), escape(new_object))) 363 363 elif request.POST.has_key("_addanother"): 364 request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % opts.verbose_name))364 request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name))) 365 365 return HttpResponseRedirect(request.path) 366 366 else: … … 418 418 LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(self.model).id, pk_value, force_unicode(new_object), CHANGE, change_message) 419 419 420 msg = _('The %(name)s "%(obj)s" was changed successfully.') % {'name': opts.verbose_name, 'obj': new_object}420 msg = _('The %(name)s "%(obj)s" was changed successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': new_object} 421 421 if request.POST.has_key("_continue"): 422 422 request.user.message_set.create(message=msg + ' ' + _("You may edit it again below.")) … … 426 426 return HttpResponseRedirect(request.path) 427 427 elif request.POST.has_key("_saveasnew"): 428 request.user.message_set.create(message=_('The %(name)s "%(obj)s" was added successfully. You may edit it again below.') % {'name': opts.verbose_name, 'obj': new_object})428 request.user.message_set.create(message=_('The %(name)s "%(obj)s" was added successfully. You may edit it again below.') % {'name': force_unicode(opts.verbose_name), 'obj': new_object}) 429 429 return HttpResponseRedirect("../%s/" % pk_value) 430 430 elif request.POST.has_key("_addanother"): 431 request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % opts.verbose_name))431 request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name))) 432 432 return HttpResponseRedirect("../add/") 433 433 else: … … 507 507 508 508 context = { 509 'title': _('Add %s') % opts.verbose_name,509 'title': _('Add %s') % force_unicode(opts.verbose_name), 510 510 'adminform': adminForm, 511 511 'is_popup': request.REQUEST.has_key('_popup'), … … 537 537 538 538 if obj is None: 539 raise Http404('%s object with primary key %r does not exist.' % ( opts.verbose_name, escape(object_id)))539 raise Http404('%s object with primary key %r does not exist.' % (force_unicode(opts.verbose_name), escape(object_id))) 540 540 541 541 if request.POST and request.POST.has_key("_saveasnew"): … … 569 569 570 570 context = { 571 'title': _('Change %s') % opts.verbose_name,571 'title': _('Change %s') % force_unicode(opts.verbose_name), 572 572 'adminform': adminForm, 573 573 'object_id': object_id, … … 634 634 635 635 if obj is None: 636 raise Http404('%s object with primary key %r does not exist.' % ( opts.verbose_name, escape(object_id)))636 raise Http404('%s object with primary key %r does not exist.' % (force_unicode(opts.verbose_name), escape(object_id))) 637 637 638 638 # Populate deleted_objects, a data structure of all related objects that … … 655 655 context = { 656 656 "title": _("Are you sure?"), 657 "object_name": opts.verbose_name,657 "object_name": force_unicode(opts.verbose_name), 658 658 "object": obj, 659 659 "deleted_objects": deleted_objects, … … 683 683 'title': _('Change history: %s') % force_unicode(obj), 684 684 'action_list': action_list, 685 'module_name': capfirst( opts.verbose_name_plural),685 'module_name': capfirst(force_unicode(opts.verbose_name_plural)), 686 686 'object': obj, 687 687 'root_path': self.admin_site.root_path,
