Well, looks like you can do this through the attribute:
self._CHEETAH__cheetahIncludes
Which is a dictionary that contains all of your includes.
Use it from your template after the include like:
$self._CHEETAH__cheetahIncludes[include_id].the_function(*args)
For me the include_id
happened to be the file path (I found this out by printing out the _CHEETAH__cheetahIncludes
dictionary first, heh). Is this guaranteed? No idea.
Do I recommend this? No. Is there a better way to access the function? Appears to not be. Are there any shortcomings? No idea, use at your own risk. Could this be useful to someone? Maybe :)
I mean it could be a useful feature because people are trying to do it, but is this feature necessary? Probably not.
My use case was I wanted to reuse a snippet that would access the parents searchList as includes do, but I wanted to reuse this include with a single hard coded argument in other templates. I could easily just make this variable that changes the behavior part of the searchList in the first place, and that is probably what you should do as well :). This would also allow me to pass it in from the application layer instead of hard coding it in my template!
This is most likely good design because it prevents the shorts cuts us developers will often take if allowed to do so easily.