Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #13443 -- Added required CSS class to the column headings on ad…

…min TabularInline formsets. Thanks to deschler for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 21d98c5ebdf7063aca8666255b31673e6af595c8 1 parent 7fa7bed
Russell Keith-Magee freakboy3742 authored
12 django/contrib/admin/helpers.py
View
@@ -218,11 +218,15 @@ def fields(self):
if fk and fk.name == field:
continue
if field in self.readonly_fields:
- label = label_for_field(field, self.opts.model, self.model_admin)
- yield (False, label)
+ yield {
+ 'label': label_for_field(field, self.opts.model, self.model_admin),
+ 'widget': {
+ 'is_hidden': False
+ },
+ 'required': False
+ }
else:
- field = self.formset.form.base_fields[field]
- yield (field.widget.is_hidden, field.label)
+ yield self.formset.form.base_fields[field]
def _media(self):
media = self.opts.media + self.formset.media
6 django/contrib/admin/templates/admin/edit_inline/tabular.html
View
@@ -7,9 +7,9 @@
{{ inline_admin_formset.formset.non_form_errors }}
<table>
<thead><tr>
- {% for is_hidden, label in inline_admin_formset.fields %}
- {% if not is_hidden %}
- <th {% if forloop.first %}colspan="2"{% endif %}>{{ label|capfirst }}</th>
+ {% for field in inline_admin_formset.fields %}
+ {% if not field.widget.is_hidden %}
+ <th{% if forloop.first %} colspan="2"{% endif %}{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }}</th>
{% endif %}
{% endfor %}
{% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %}
Please sign in to comment.
Something went wrong with that request. Please try again.