Author: mtredinnick
Date: 2009-03-24 03:22:23 -0500 (Tue, 24 Mar 2009)
New Revision: 10141

Modified:
   django/trunk/django/contrib/admin/options.py
Log:
Fixed #10600 -- Allow for format marker reordering in a translatable string.

Modified: django/trunk/django/contrib/admin/options.py
===================================================================
--- django/trunk/django/contrib/admin/options.py        2009-03-24 07:14:19 UTC 
(rev 10140)
+++ django/trunk/django/contrib/admin/options.py        2009-03-24 08:22:23 UTC 
(rev 10141)
@@ -457,11 +457,11 @@
     def delete_selected(self, request, queryset):
         """
         Default action which deletes the selected objects.
-        
+
         In the first step, it displays a confirmation page whichs shows all
         the deleteable objects or, if the user has no permission one of the
         related childs (foreignkeys) it displays a "permission denied" message.
-        
+
         In the second step delete all selected objects and display the change
         list again.
         """
@@ -474,7 +474,7 @@
 
         # Populate deletable_objects, a data structure of all related objects 
that
         # will also be deleted.
-        
+
         # deletable_objects must be a list if we want to use '|unordered_list' 
in the template
         deletable_objects = []
         perms_needed = set()
@@ -495,9 +495,9 @@
                     obj_display = force_unicode(obj)
                     self.log_deletion(request, obj, obj_display)
                 queryset.delete()
-                self.message_user(request, _("Successfully deleted %d %s.") % (
-                    n, model_ngettext(self.opts, n)
-                ))
+                self.message_user(request, _("Successfully deleted %(count)d 
%(items)s.") % {
+                    "count": n, "items": model_ngettext(self.opts, n)
+                })
             # Return None to display the change list page again.
             return None
 
@@ -512,7 +512,7 @@
             "app_label": app_label,
             'action_checkbox_name': helpers.ACTION_CHECKBOX_NAME,
         }
-        
+
         # Display the confirmation page
         return render_to_response(self.delete_confirmation_template or [
             "admin/%s/%s/delete_selected_confirmation.html" % (app_label, 
opts.object_name.lower()),
@@ -685,15 +685,15 @@
         if action_form.is_valid():
             action = action_form.cleaned_data['action']
             func, name, description = self.get_actions(request)[action]
-            
-            # Get the list of selected PKs. If nothing's selected, we can't 
+
+            # Get the list of selected PKs. If nothing's selected, we can't
             # perform an action on it, so bail.
             selected = request.POST.getlist(helpers.ACTION_CHECKBOX_NAME)
             if not selected:
                 return None
 
             response = func(request, queryset.filter(pk__in=selected))
-                        
+
             # Actions may return an HttpResponse, which will be used as the
             # response from the POST. If not, we'll be a good little HTTP
             # citizen and redirect back to the changelist page.
@@ -901,7 +901,7 @@
             response = self.response_action(request, 
queryset=cl.get_query_set())
             if response:
                 return response
-                
+
         # If we're allowing changelist editing, we need to construct a formset
         # for the changelist given all the fields to be edited. Then we'll
         # use the formset to validate/process POSTed data.
@@ -946,10 +946,10 @@
             media = self.media + formset.media
         else:
             media = self.media
-            
+
         # Build the action form and populate it with available actions.
         action_form = self.action_form(auto_id=None)
-        action_form.fields['action'].choices = 
self.get_action_choices(request)        
+        action_form.fields['action'].choices = self.get_action_choices(request)
 
         context = {
             'title': cl.title,


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to