Ticket #10698: 10698.patch

File 10698.patch, 3.7 KB (added by Matthias Kestenholz, 11 years ago)
  • django/contrib/admin/helpers.py

    diff --git a/django/contrib/admin/helpers.py b/django/contrib/admin/helpers.py
    index 5cb8f1f..5eff2fc 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.admin_helpers_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..e95a6a0 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.admin_helpers_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..0694e31 100644
    a b  
    1414     {% endfor %}
    1515     {% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %}
    1616     </tr></thead>
    17    
     17
    1818     {% for inline_admin_form in inline_admin_formset %}
    1919        {% if inline_admin_form.form.non_field_errors %}
    2020        <tr><td colspan="{{ inline_admin_form.field_count }}">{{ inline_admin_form.form.non_field_errors }}</td></tr>
     
    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.admin_helpers_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 %}
     
    4848            {% endfor %}
    4949          {% endfor %}
    5050        {% endfor %}
    51                
     51
    5252        {% if inline_admin_formset.formset.can_delete %}
    5353          <td class="delete">{% if inline_admin_form.original %}{{ inline_admin_form.deletion_field.field }}{% endif %}</td>
    5454        {% endif %}
    55        
     55
    5656        </tr>
    5757
    5858     {% endfor %}
    59    
     59
    6060   </table>
    61    
     61
    6262</fieldset>
    6363  </div>
    64  
     64
    6565  {# <ul class="tools"> #}
    6666  {#   <li><a class="add" href="">Add another {{ inline_admin_formset.opts.verbose_name|title }}</a></li> #}
    6767  {# </ul> #}
    68  
     68
    6969</div>
Back to Top