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:
parent
39c6f4fb88
commit
fb66b37337
|
@ -402,6 +402,13 @@ class AdminBoundField(BoundField):
|
||||||
def html_error_list(self):
|
def html_error_list(self):
|
||||||
return " ".join([form_field.html_error_list() for form_field in self.form_fields if form_field.errors])
|
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):
|
class AdminBoundFieldLine(BoundFieldLine):
|
||||||
def __init__(self, field_line, field_mapping, original):
|
def __init__(self, field_line, field_mapping, original):
|
||||||
super(AdminBoundFieldLine, self).__init__(field_line, field_mapping, original, AdminBoundField)
|
super(AdminBoundFieldLine, self).__init__(field_line, field_mapping, original, AdminBoundField)
|
||||||
|
|
Loading…
Reference in New Issue