docs: def link_to_model(instance, text=None, *args, **kwargs):
      """
      Returns HTML in the form::
  
          <a href="{{ instance.get_absolute_url }}">{{ text }}</a>
  
      If ``text`` is provided and isn't empty, it will be used as the hyperlinked text.
  
      If ``text`` isn't available, then ``kwargs['rich_value']`` will be consulted instead.
  
      Failing those checks, the helper will fall back to simply using ``unicode(instance)`` as the
      link text.
  
      If the helper is called in place (rather than providing the helper reference directly), it can
      receive a special ``key`` argument, which is a mapping function that will receiving the instance
      (once it is available) and return some value from that instance.  That new value will be sent to
      the helper in the place of the instance.
  
      Examples::
  
          # Generate a simple href tag for instance.get_absolute_url()
          name = columns.TextColumn("Name", sources=['name'],
                                            processor=link_to_model)
  
          # Generate an href tag for instance.relatedobject.get_absolute_url()
          # Note that without the use of link_to_model(key=...), the object going into
          # the link_to_model helper would be the row instance, not the thing looked up by the
          # column's sources.
          name = columns.TextColumn("Name", sources=['relatedobject__name'],
                                            processor=link_to_model(key=getattr('relatedobject')))
      """
      if not text:
          text = kwargs.get('rich_value') or six.text_type(instance)
      return u"""<a href="{0}">{1}</a>""".format(instance.get_absolute_url(), text)