def db_file_widget(cls):
def get_link_display(url):<EOL><INDENT>unquoted = unquote(url.split('<STR_LIT>')[-<NUM_LIT:1>])<EOL>if sys.version_info.major == <NUM_LIT:2>:  <EOL><INDENT>from django.utils.encoding import force_unicode<EOL>unquoted = force_unicode(unquoted)<EOL><DEDENT>return escape(unquoted)<EOL><DEDENT>def get_template_substitution_values(self, value):<EOL><INDENT>subst = super(cls, self).get_template_substitution_values(value)<EOL>subst['<STR_LIT>'] = get_link_display(value.url)<EOL>return subst<EOL><DEDENT>setattr(cls,<EOL>'<STR_LIT>',<EOL>get_template_substitution_values)<EOL>def get_context(self, name, value, attrs):<EOL><INDENT>context = super(cls, self).get_context(name, value, attrs)<EOL>if value and hasattr(value, '<STR_LIT:url>'):<EOL><INDENT>context['<STR_LIT>']['<STR_LIT>'] = get_link_display(value.url)<EOL><DEDENT>return context<EOL><DEDENT>setattr(cls, '<STR_LIT>', get_context)<EOL>return cls<EOL>
Edit the download-link inner text.