I did not refer to django template, but to a string template; something like:
"jQuery(this).closest('form').append("
                   "jQuery('<input>').attr('type', 'hidden').attr("
                     "'name', '%s').val(true)"
                   "

and then you have
on_click = ON_CLICK % '_schedule_sub_pressed'

Something like that