@require_GET
def what_links_here(request, document_slug):
 locale = request.GET.get('locale', request.LANGUAGE_CODE)
 doc = get_object_or_404(Document, locale=locale, slug=document_slug)
 links = {}
 for l in doc.links_to():
  if (doc.locale == l.linked_from.locale):
   if (l.kind not in links):
    links[l.kind] = []
   links[l.kind].append(l.linked_from)
 c = {'document': doc, 'relations': links}
 return render(request, 'wiki/what_links_here.html', c)

@ require_GET def what_links_here ( request , document_slug ) : locale = request . GET . get ( 'locale' , request . LANGUAGE_CODE ) doc = get_object_or_404 ( Document , locale = locale , slug = document_slug ) links = { } for l in doc . links_to ( ) : if ( doc . locale == l . linked_from . locale ) : if ( l . kind not in links ) : links [ l . kind ] = [ ] links [ l . kind ] . append ( l . linked_from ) c = { 'document' : doc , 'relations' : links } return render ( request , 'wiki/what_links_here.html' , c )
list all documents that link to a document .