| 1 | Index: /home/aerobitch/Projects/django-trunk/django/contrib/admin/options.py
|
|---|
| 2 | ===================================================================
|
|---|
| 3 | --- /home/aerobitch/Projects/django-trunk/django/contrib/admin/options.py (revision 8135)
|
|---|
| 4 | +++ /home/aerobitch/Projects/django-trunk/django/contrib/admin/options.py (working copy)
|
|---|
| 5 | @@ -344,7 +344,7 @@
|
|---|
| 6 |
|
|---|
| 7 | pk_value = new_object._get_pk_val()
|
|---|
| 8 | LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(self.model).id, pk_value, force_unicode(new_object), ADDITION)
|
|---|
| 9 | - msg = _('The %(name)s "%(obj)s" was added successfully.') % {'name': opts.verbose_name, 'obj': new_object}
|
|---|
| 10 | + msg = _('The %(name)s "%(obj)s" was added successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': new_object}
|
|---|
| 11 | # Here, we distinguish between different save types by checking for
|
|---|
| 12 | # the presence of keys in request.POST.
|
|---|
| 13 | if request.POST.has_key("_continue"):
|
|---|
| 14 | @@ -358,7 +358,7 @@
|
|---|
| 15 | # escape() calls force_unicode.
|
|---|
| 16 | (escape(pk_value), escape(new_object)))
|
|---|
| 17 | elif request.POST.has_key("_addanother"):
|
|---|
| 18 | - request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % opts.verbose_name))
|
|---|
| 19 | + request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name)))
|
|---|
| 20 | return HttpResponseRedirect(request.path)
|
|---|
| 21 | else:
|
|---|
| 22 | request.user.message_set.create(message=msg)
|
|---|
| 23 | @@ -414,7 +414,7 @@
|
|---|
| 24 | change_message = _('No fields changed.')
|
|---|
| 25 | LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(self.model).id, pk_value, force_unicode(new_object), CHANGE, change_message)
|
|---|
| 26 |
|
|---|
| 27 | - msg = _('The %(name)s "%(obj)s" was changed successfully.') % {'name': opts.verbose_name, 'obj': new_object}
|
|---|
| 28 | + msg = _('The %(name)s "%(obj)s" was changed successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': new_object}
|
|---|
| 29 | if request.POST.has_key("_continue"):
|
|---|
| 30 | request.user.message_set.create(message=msg + ' ' + _("You may edit it again below."))
|
|---|
| 31 | if request.REQUEST.has_key('_popup'):
|
|---|
| 32 | @@ -422,10 +422,10 @@
|
|---|
| 33 | else:
|
|---|
| 34 | return HttpResponseRedirect(request.path)
|
|---|
| 35 | elif request.POST.has_key("_saveasnew"):
|
|---|
| 36 | - 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})
|
|---|
| 37 | + 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})
|
|---|
| 38 | return HttpResponseRedirect("../%s/" % pk_value)
|
|---|
| 39 | elif request.POST.has_key("_addanother"):
|
|---|
| 40 | - request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % opts.verbose_name))
|
|---|
| 41 | + request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name)))
|
|---|
| 42 | return HttpResponseRedirect("../add/")
|
|---|
| 43 | else:
|
|---|
| 44 | request.user.message_set.create(message=msg)
|
|---|
| 45 | @@ -503,7 +503,7 @@
|
|---|
| 46 | inline_admin_formsets.append(inline_admin_formset)
|
|---|
| 47 |
|
|---|
| 48 | context = {
|
|---|
| 49 | - 'title': _('Add %s') % opts.verbose_name,
|
|---|
| 50 | + 'title': _('Add %s') % force_unicode(opts.verbose_name),
|
|---|
| 51 | 'adminform': adminForm,
|
|---|
| 52 | 'is_popup': request.REQUEST.has_key('_popup'),
|
|---|
| 53 | 'show_delete': False,
|
|---|
| 54 | @@ -533,7 +533,7 @@
|
|---|
| 55 | raise PermissionDenied
|
|---|
| 56 |
|
|---|
| 57 | if obj is None:
|
|---|
| 58 | - raise Http404('%s object with primary key %r does not exist.' % (opts.verbose_name, escape(object_id)))
|
|---|
| 59 | + raise Http404('%s object with primary key %r does not exist.' % (force_unicode(opts.verbose_name), escape(object_id)))
|
|---|
| 60 |
|
|---|
| 61 | if request.POST and request.POST.has_key("_saveasnew"):
|
|---|
| 62 | return self.add_view(request, form_url='../../add/')
|
|---|
| 63 | @@ -565,7 +565,7 @@
|
|---|
| 64 | media = media + inline_admin_formset.media
|
|---|
| 65 |
|
|---|
| 66 | context = {
|
|---|
| 67 | - 'title': _('Change %s') % opts.verbose_name,
|
|---|
| 68 | + 'title': _('Change %s') % force_unicode(opts.verbose_name),
|
|---|
| 69 | 'adminform': adminForm,
|
|---|
| 70 | 'object_id': object_id,
|
|---|
| 71 | 'original': obj,
|
|---|
| 72 | @@ -630,7 +630,7 @@
|
|---|
| 73 | raise PermissionDenied
|
|---|
| 74 |
|
|---|
| 75 | if obj is None:
|
|---|
| 76 | - raise Http404('%s object with primary key %r does not exist.' % (opts.verbose_name, escape(object_id)))
|
|---|
| 77 | + raise Http404('%s object with primary key %r does not exist.' % (force_unicode(opts.verbose_name), escape(object_id)))
|
|---|
| 78 |
|
|---|
| 79 | # Populate deleted_objects, a data structure of all related objects that
|
|---|
| 80 | # will also be deleted.
|
|---|
| 81 | @@ -651,7 +651,7 @@
|
|---|
| 82 |
|
|---|
| 83 | context = {
|
|---|
| 84 | "title": _("Are you sure?"),
|
|---|
| 85 | - "object_name": opts.verbose_name,
|
|---|
| 86 | + "object_name": force_unicode(opts.verbose_name),
|
|---|
| 87 | "object": obj,
|
|---|
| 88 | "deleted_objects": deleted_objects,
|
|---|
| 89 | "perms_lacking": perms_needed,
|
|---|
| 90 | @@ -679,7 +679,7 @@
|
|---|
| 91 | context = {
|
|---|
| 92 | 'title': _('Change history: %s') % force_unicode(obj),
|
|---|
| 93 | 'action_list': action_list,
|
|---|
| 94 | - 'module_name': capfirst(opts.verbose_name_plural),
|
|---|
| 95 | + 'module_name': capfirst(force_unicode(opts.verbose_name_plural)),
|
|---|
| 96 | 'object': obj,
|
|---|
| 97 | 'root_path': self.admin_site.root_path,
|
|---|
| 98 | }
|
|---|