Added missing original_url method to AdminBoundField

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@1722 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Robert Wittams 2005-12-18 09:43:53 +00:00
parent 39c6f4fb88
commit fb66b37337
1 changed files with 7 additions and 0 deletions

View File

@ -402,6 +402,13 @@ class AdminBoundField(BoundField):
def html_error_list(self):
return " ".join([form_field.html_error_list() for form_field in self.form_fields if form_field.errors])
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 ''
class AdminBoundFieldLine(BoundFieldLine):
def __init__(self, field_line, field_mapping, original):
super(AdminBoundFieldLine, self).__init__(field_line, field_mapping, original, AdminBoundField)