def massaged_documents_for_json(documents, user):
 docs = {}
 for document in documents:
  try:
   url = ((document.content_object and hasattr(document.content_object, 'get_absolute_url') and document.content_object.get_absolute_url()) or '')
  except:
   LOG.exception('failed to get absolute url')
   url = ''
  docs[document.id] = massage_doc_for_json(document, user, url)
 return docs

def massaged_documents_for_json ( documents , user ) : docs = { } for document in documents : try : url = ( ( document . content_object and hasattr ( document . content_object , 'get_absolute_url' ) and document . content_object . get_absolute_url ( ) ) or '' ) except : LOG . exception ( 'failed to get absolute url' ) url = '' docs [ document . id ] = massage_doc_for_json ( document , user , url ) return docs
var documents_defaults = { 1: { id: 1 .