Ticket #2524: views_i18n.diff

File views_i18n.diff, 2.8 KB (added by mir@…, 18 years ago)

patch

  • django/views/generic/create_update.py

    From nobody Mon Sep 17 00:00:00 2001
    From: Michael Radziej <mir@noris.de>
    Date: Fri Aug 11 12:33:10 2006 +0200
    Subject: [PATCH] views i18n
    
    adaption to new upstream version
    
    Merged patch views-i18n.
    (Base: d8703df747c3141262b48926ab7650ceff88f0d1)
    (Last: c04ecfdf6ae5f4f2286b4688a1d9d3432a569cce)
    
    ---
    
     django/views/generic/create_update.py |    7 ++++---
     1 files changed, 4 insertions(+), 3 deletions(-)
    
    base 4e7730f37c8d07fb0ebad2984cb87681db33925c
    last a511b9776b2444555f0b3d2954a23e49e4414dba
    diff --git a/django/views/generic/create_update.py b/django/views/generic/create_update.py
    index f8953e2fbcb989145ad25365cbd443b875f1fb71..b3dca69b03ecee455d9e1e78e52657527831e2cb 100644
    a b from django.contrib.auth.views import re  
    66from django.template import RequestContext
    77from django.http import Http404, HttpResponse, HttpResponseRedirect
    88from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
     9from django.utils.translation import gettext
    910
    1011def create_object(request, model, template_name=None,
    1112        template_loader=loader, extra_context=None, post_save_redirect=None,
    def create_object(request, model, templa  
    4142            new_object = manipulator.save(new_data)
    4243
    4344            if request.user.is_authenticated():
    44                 request.user.message_set.create(message="The %s was created successfully." % model._meta.verbose_name)
     45                request.user.message_set.create(message=gettext("The %(verbose_name)s was created successfully.") % {"verbose_name": model._meta.verbose_name})
    4546
    4647            # Redirect to the new object: first by trying post_save_redirect,
    4748            # then by obj.get_absolute_url; fail if neither works.
    def update_object(request, model, object  
    118119            object = manipulator.save(new_data)
    119120
    120121            if request.user.is_authenticated():
    121                 request.user.message_set.create(message="The %s was updated successfully." % model._meta.verbose_name)
     122                request.user.message_set.create(message=gettext("The %(verbose_name)s was updated successfully.") % {"verbose_name": model._meta.verbose_name})
    122123
    123124            # Do a post-after-redirect so that reload works, etc.
    124125            if post_save_redirect:
    def delete_object(request, model, post_d  
    185186    if request.method == 'POST':
    186187        object.delete()
    187188        if request.user.is_authenticated():
    188             request.user.message_set.create(message="The %s was deleted." % model._meta.verbose_name)
     189            request.user.message_set.create(message=gettext("The %(verbose_name)s was deleted.") % {"verbose_name": model._meta.verbose_name})
    189190        return HttpResponseRedirect(post_delete_redirect)
    190191    else:
    191192        if not template_name:
Back to Top