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
|
6 | 6 | from django.template import RequestContext |
7 | 7 | from django.http import Http404, HttpResponse, HttpResponseRedirect |
8 | 8 | from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured |
| 9 | from django.utils.translation import gettext |
9 | 10 | |
10 | 11 | def create_object(request, model, template_name=None, |
11 | 12 | template_loader=loader, extra_context=None, post_save_redirect=None, |
… |
… |
def create_object(request, model, templa
|
41 | 42 | new_object = manipulator.save(new_data) |
42 | 43 | |
43 | 44 | 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}) |
45 | 46 | |
46 | 47 | # Redirect to the new object: first by trying post_save_redirect, |
47 | 48 | # then by obj.get_absolute_url; fail if neither works. |
… |
… |
def update_object(request, model, object
|
118 | 119 | object = manipulator.save(new_data) |
119 | 120 | |
120 | 121 | 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}) |
122 | 123 | |
123 | 124 | # Do a post-after-redirect so that reload works, etc. |
124 | 125 | if post_save_redirect: |
… |
… |
def delete_object(request, model, post_d
|
185 | 186 | if request.method == 'POST': |
186 | 187 | object.delete() |
187 | 188 | 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}) |
189 | 190 | return HttpResponseRedirect(post_delete_redirect) |
190 | 191 | else: |
191 | 192 | if not template_name: |