def context_dict(revision):
 document = revision.document
 from_revision = revision.get_previous()
 to_revision = revision
 diff = revisions_unified_diff(from_revision, to_revision)
 context = {'document_title': document.title, 'creator': revision.creator, 'diff': diff}
 if from_revision:
  compare_url = get_compare_url(document, from_revision.id, to_revision.id)
 else:
  compare_url = ''
 link_urls = {'user_url': revision.creator.get_absolute_url(), 'compare_url': compare_url, 'view_url': document.get_absolute_url(), 'edit_url': document.get_edit_url(), 'history_url': reverse('wiki.document_revisions', locale=document.locale, args=[document.slug])}
 for (name, url) in link_urls.items():
  context[name] = add_utm(url, 'Wiki Doc Edits')
 return context

def context_dict ( revision ) : document = revision . document from_revision = revision . get_previous ( ) to_revision = revision diff = revisions_unified_diff ( from_revision , to_revision ) context = { 'document_title' : document . title , 'creator' : revision . creator , 'diff' : diff } if from_revision : compare_url = get_compare_url ( document , from_revision . id , to_revision . id ) else : compare_url = '' link_urls = { 'user_url' : revision . creator . get_absolute_url ( ) , 'compare_url' : compare_url , 'view_url' : document . get_absolute_url ( ) , 'edit_url' : document . get_edit_url ( ) , 'history_url' : reverse ( 'wiki.document_revisions' , locale = document . locale , args = [ document . slug ] ) } for ( name , url ) in link_urls . items ( ) : context [ name ] = add_utm ( url , 'Wiki Doc Edits' ) return context
return a dict that fills in the blanks in notification templates .