@task
def build_json_data_for_document(pk, stale):
 document = Document.objects.get(pk=pk)
 document.get_json_data(stale=stale)
 if (document.parent is not None):
  parent_json = json.dumps(document.parent.build_json_data())
  Document.objects.filter(pk=document.parent.pk).update(json=parent_json)

@ task def build_json_data_for_document ( pk , stale ) : document = Document . objects . get ( pk = pk ) document . get_json_data ( stale = stale ) if ( document . parent is not None ) : parent_json = json . dumps ( document . parent . build_json_data ( ) ) Document . objects . filter ( pk = document . parent . pk ) . update ( json = parent_json )
force-refresh cached json data after rendering .