code: def get_document_field_display(self, field_name, field):
          
          document = getattr(self.instance, field_name)
          if document:
              return mark_safe(
                  '<a href="%s">%s <span class="meta">(%s, %s)</span></a>' % (
                      document.url,
                      document.title,
                      document.file_extension.upper(),
                      filesizeformat(document.file.size),
                  )
              )
          return self.model_admin.get_empty_value_display()
docs: Render a link to a document