Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #10600 -- Allow for format marker reordering in a translatable …

…string.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10141 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 2dfdc2b01b9bdfe8fcff2706fef678b2186a6cdf 1 parent 37f25d4
@malcolmt malcolmt authored
Showing with 13 additions and 13 deletions.
  1. +13 −13 django/contrib/admin/options.py
View
26 django/contrib/admin/options.py
@@ -457,11 +457,11 @@ def get_action(self, action):
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 @@ def delete_selected(self, request, queryset):
# 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 @@ def delete_selected(self, request, queryset):
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 @@ def delete_selected(self, request, queryset):
"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 @@ def response_action(self, request, queryset):
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 @@ def changelist_view(self, request, extra_context=None):
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 @@ def changelist_view(self, request, extra_context=None):
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,
Please sign in to comment.
Something went wrong with that request. Please try again.