Split the render_compressed method in templatetags for easier subclassing.
The base mixin for the template tags, PipelineMixin, performed the bulk of its rendering logic in the render_compressed() method. It handled both rendering output files (if PIPELINE_ENABLED was True), or source files (if False). Due to the complexity of this method, it was difficult for a subclass (which may need to perform more specialized logic) to override this method without copying the code. This splits out that function into two new utility methods, render_compressed_sources() and render_compressed_output(). These take the same arguments as render_compressed(), and are called by that method as well. This allows a subclass to more easily replace the logic for determining which to call, or to replace the logic for either of these renders.
Showing
Please
register
or
sign in
to comment