Fixed django admin inline verbose name (plural/singular). Bug #18549 #498

wants to merge 6 commits into


None yet

6 participants

ptone and others added some commits Oct 31, 2012
@ptone ptone Merge pull request #481 from epicserve/testing_docs_update
Added timeout local to selenium sample test

The timeout variable wasn't defined, which was a little confusing.
@akaariai akaariai Removed dupe_avoidance from sql/query and sql/
The dupe avoidance logic was removed as it doesn't seem to do anything,
it is complicated, and it has nearly zero documentation.

The removal of dupe_avoidance allowed for refactoring of both the
implementation and signature of Query.join(). This refactoring cascades
again to some other parts. The most significant of them is the changes
in qs.combine(), and compiler.select_related_descent().
@aaugustin aaugustin Fixed #17083 -- Allowed sessions to use non-default cache. 146ed13
@andrewgodwin andrewgodwin Fixed #19070 -- urlize filter no longer raises exceptions on 2.7
Thanks to claudep for the patch.
@harph harph Fixed django admin inline verbose name (plural/singular). Bug #18549 36a7bb0
@ptone ptone and 1 other commented on an outdated diff Nov 5, 2012
@@ -1,6 +1,14 @@
{% load i18n admin_static %}
<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
- <h2>{{ inline_admin_formset.opts.verbose_name_plural|title }}</h2>
+ <h2>
+ {% with formset_opts=inline_admin_formset.opts max_num=inline_admin_formset.formset.max_num %}
+ {% if not max_num or max_num > 1 %}
+ {{ formset_opts.verbose_name_plural|capfirst }}
ptone Nov 5, 2012

any particular reason you've switched from title to capfirst for the filter?

harph Nov 5, 2012

You're right. I did it copying from tabular.html considering that it was the same behavior. Actually now that I see it, maybe both templates should be using title instead of capfirst.

@harph harph Changed capfirst for title filter to leave as it was
I made a mistake changing the filter from title to capfirst when 
I fixed the ticket #18549. I changed the filter back to title and
but it stills having the patch.
Django member

I left some comments for improvement on the ticket. Please open a new PR if you can update this. Thanks!

@timgraham timgraham closed this Oct 17, 2013
@timgraham timgraham commented on the diff Oct 17, 2013
@@ -3,7 +3,15 @@
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
<fieldset class="module">
- <h2>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h2>
+ <h2>
+ {% with formset_opts=inline_admin_formset.opts max_num=inline_admin_formset.formset.max_num %}
+ {% if not max_num or max_num > 1 %}
timgraham Oct 17, 2013

seems like {% if max_num == 1 %} and then switching the branches would be simpler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment