Ticket #4846: main.py.patch

File main.py.patch, 6.1 KB (added by daybreaker12@…, 13 years ago)

patch for contrib/admin/views/main.py

Line 
1264c264
2<             msg = _('The %(name)s "%(obj)s" was added successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': new_object}
3---
4>             msg = _(u'The %(name)s "%(obj)s" was added successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(new_object)}
5268c268
6<                 request.user.message_set.create(message=msg + ' ' + _("You may edit it again below."))
7---
8>                 request.user.message_set.create(message=msg + ' ' + _(u"You may edit it again below."))
9274,275c274,275
10<                     pk_value = '"%s"' % pk_value.replace('"', '\\"')
11<                 return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, %s, "%s");</script>' % \
12---
13>                     pk_value = u'"%s"' % pk_value.replace('"', '\\"')
14>                 return HttpResponse(u'<script type="text/javascript">opener.dismissAddAnotherPopup(window, %s, "%s");</script>' % \
15278c278
16<                 request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name)))
17---
18>                 request.user.message_set.create(message=msg + ' ' + (_(u"You may add another %s below.") % force_unicode(opts.verbose_name)))
19296c296
20<         'title': _('Add %s') % force_unicode(opts.verbose_name),
21---
22>         'title': _(u'Add %s') % force_unicode(opts.verbose_name),
23312c312
24<         raise Http404("App %r, model %r, not found" % (app_label, model_name))
25---
26>         raise Http404(u"App %r, model %r, not found" % (app_label, model_name))
27324c324
28<         raise Http404('%s object with primary key %r does not exist' % (model_name, escape(object_id)))
29---
30>         raise Http404(u'%s object with primary key %r does not exist' % (model_name, escape(object_id)))
31342c342
32<                 change_message.append(_('Added %s.') % get_text_list(manipulator.fields_added, _('and')))
33---
34>                 change_message.append(_(u'Added %s.') % get_text_list(manipulator.fields_added, _('and')))
35344c344
36<                 change_message.append(_('Changed %s.') % get_text_list(manipulator.fields_changed, _('and')))
37---
38>                 change_message.append(_(u'Changed %s.') % get_text_list(manipulator.fields_changed, _('and')))
39346c346
40<                 change_message.append(_('Deleted %s.') % get_text_list(manipulator.fields_deleted, _('and')))
41---
42>                 change_message.append(_(u'Deleted %s.') % get_text_list(manipulator.fields_deleted, _('and')))
43349c349
44<                 change_message = _('No fields changed.')
45---
46>                 change_message = _(u'No fields changed.')
47352c352
48<             msg = _('The %(name)s "%(obj)s" was changed successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': new_object}
49---
50>             msg = _(u'The %(name)s "%(obj)s" was changed successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(new_object)}
51354c354
52<                 request.user.message_set.create(message=msg + ' ' + _("You may edit it again below."))
53---
54>                 request.user.message_set.create(message=msg + ' ' + _(u"You may edit it again below."))
55360,361c360,361
56<                 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})
57<                 return HttpResponseRedirect("../%s/" % pk_value)
58---
59>                 request.user.message_set.create(message=_(u'The %(name)s "%(obj)s" was added successfully. You may edit it again below.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(new_object)})
60>                 return HttpResponseRedirect(u"../%s/" % pk_value)
61363c363
62<                 request.user.message_set.create(message=msg + ' ' + (_("You may add another %s below.") % force_unicode(opts.verbose_name)))
63---
64>                 request.user.message_set.create(message=msg + ' ' + (_(u"You may add another %s below.") % force_unicode(opts.verbose_name)))
65392c392
66<             func = getattr(manipulator.original_object, 'get_%s_list' %
67---
68>             func = getattr(manipulator.original_object, u'get_%s_list' %
69398c398
70<         'title': _('Change %s') % force_unicode(opts.verbose_name),
71---
72>         'title': _(u'Change %s') % force_unicode(opts.verbose_name),
73431c431
74<                     p = '%s.%s' % (related.opts.app_label, related.opts.get_delete_permission())
75---
76>                     p = u'%s.%s' % (related.opts.app_label, related.opts.get_delete_permission())
77462c462
78<                 p = '%s.%s' % (related.opts.app_label, related.opts.get_delete_permission())
79---
80>                 p = u'%s.%s' % (related.opts.app_label, related.opts.get_delete_permission())
81483c483
82<                     nh(deleted_objects, current_depth, [_('One or more %(fieldname)s in %(name)s: %(obj)s') % \
83---
84>                     nh(deleted_objects, current_depth, [_(u'One or more %(fieldname)s in %(name)s: %(obj)s') % \
85488c488
86<                         (_('One or more %(fieldname)s in %(name)s:') % {'fieldname': force_unicode(related.field.verbose_name), 'name': force_unicode(related.opts.verbose_name)}) + \
87---
88>                         (_(u'One or more %(fieldname)s in %(name)s:') % {'fieldname': force_unicode(related.field.verbose_name), 'name': force_unicode(related.opts.verbose_name)}) + \
89502c502
90<         raise Http404("App %r, model %r, not found" % (app_label, model_name))
91---
92>         raise Http404(u"App %r, model %r, not found" % (app_label, model_name))
93520c520
94<         request.user.message_set.create(message=_('The %(name)s "%(obj)s" was deleted successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': obj_display})
95---
96>         request.user.message_set.create(message=_(u'The %(name)s "%(obj)s" was deleted successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(obj_display)})
97539c539
98<         raise Http404("App %r, model %r, not found" % (app_label, model_name))
99---
100>         raise Http404(u"App %r, model %r, not found" % (app_label, model_name))
101545c545
102<         'title': _('Change history: %s') % obj,
103---
104>         'title': _(u'Change history: %s') % obj,
Back to Top