id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux
1077 "BoundField class doesn't have ""original_url"" method, used in file widget in Admin" Yango Adrian Holovaty "Without the original_url method, the field widget of the admin app doesn't link to the file, as it calls the original_url method of the bound_field:
{{{
{% load admin_modify %}{% load i18n %}{% if bound_field.original_value %}
{% trans ""Currently"" %}:
}}}
''''''
{{{
{{ bound_field.original_value }}
{% trans ""Change"" %}: {% output_all bound_field.form_fields %}
{% else %} {% output_all bound_field.form_fields %} {% endif %}
}}}
(This isn't the exact version of current SVN, i added l10n to it, hugo- said he'd file a ticket about it)
So, I wrote this version of it:
{{{
def original_url(self):
if self.is_file_field and self.original and self.field.attname:
url_method = getattr(self.original, 'get_%s_url' % self.field.attname)
if callable(url_method):
return url_method()
return ''
}}}
And now the link is filled with the appropriate values (line 78 of core/meta/fields.py)" defect closed contrib.admin dev normal fixed Unreviewed 0 0 0 0 0 0