def render_from_entry(template_string, entry):
 variables = copy(entry.store)
 variables[u'now'] = datetime.now()
 if (hasattr(entry, u'task') and (entry.task is not None)):
  if (u'task' not in variables):
   variables[u'task'] = entry.task.name
  variables[u'task_name'] = entry.task.name
 return render(template_string, variables)

def render_from_entry ( template_string , entry ) : variables = copy ( entry . store ) variables [ u'now' ] = datetime . now ( ) if ( hasattr ( entry , u'task' ) and ( entry . task is not None ) ) : if ( u'task' not in variables ) : variables [ u'task' ] = entry . task . name variables [ u'task_name' ] = entry . task . name return render ( template_string , variables )
renders a template or template string with an entry as its context .