Ticket #10963: 0001-changed-attribute-name-holding-an-inline-instance-s.patch

File 0001-changed-attribute-name-holding-an-inline-instance-s.patch, 2.7 KB (added by tclineks, 6 years ago)
  • django/contrib/admin/helpers.py

    diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
    index 9312eab..1b47027 100644
    a b class InlineAdminForm(AdminForm): 
    137137        self.formset = formset
    138138        self.original = original
    139139        if original is not None:
    140             self.original.content_type_id = ContentType.objects.get_for_model(original).pk
     140            self.original.inline_model_content_type_id = ContentType.objects.get_for_model(original).pk
    141141        self.show_url = original and hasattr(original, 'get_absolute_url')
    142142        super(InlineAdminForm, self).__init__(form, fieldsets, prepopulated_fields)
    143143
  • django/contrib/admin/templates/admin/edit_inline/stacked.html

    diff --git a/django/contrib/admin/templates/admin/edit_inline/stacked.html b/django/contrib/admin/templates/admin/edit_inline/stacked.html
    index 8548855..179d902 100644
    a b  
    1010    {% if inline_admin_formset.formset.can_delete and inline_admin_form.original %}<span class="delete">{{ inline_admin_form.deletion_field.field }} {{ inline_admin_form.deletion_field.label_tag }}</span>{% endif %}
    1111  </h3>
    1212  {% if inline_admin_form.show_url %}
    13   <p><a href="../../../r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a></p>
     13  <p><a href="../../../r/{{ inline_admin_form.original.inline_model_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a></p>
    1414  {% endif %}
    1515  {% if inline_admin_form.form.non_field_errors %}{{ inline_admin_form.form.non_field_errors }}{% endif %}
    1616
  • django/contrib/admin/templates/admin/edit_inline/tabular.html

    diff --git a/django/contrib/admin/templates/admin/edit_inline/tabular.html b/django/contrib/admin/templates/admin/edit_inline/tabular.html
    index 820928a..3f88f73 100644
    a b  
    2424        <td class="original">
    2525          {% if inline_admin_form.original or inline_admin_form.show_url %}<p>
    2626          {% if inline_admin_form.original %} {{ inline_admin_form.original }}{% endif %}
    27           {% if inline_admin_form.show_url %}<a href="../../../r/{{ inline_admin_form.original.content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a>{% endif %}
     27          {% if inline_admin_form.show_url %}<a href="../../../r/{{ inline_admin_form.original.inline_model_content_type_id }}/{{ inline_admin_form.original.id }}/">{% trans "View on site" %}</a>{% endif %}
    2828            </p>{% endif %}
    2929          {{ inline_admin_form.pk_field.field }} {{ inline_admin_form.fk_field.field }}
    3030          {% spaceless %}
Back to Top