Proof of concept: Support for Django cached template loader.
In the current version, Djedi is completely useless when using the Django cached template loader. The reason is that Djedi currently relies on the nodes being instantiated on each request. When using the cached loader the nodes are instantiated only on the first template load and being cached until the template cache is cleared. When using cached loaders, it's neither possible to edit nodes using the editor nor will they reflect language changes.
This patch provides a new template loader, DjediCachedLoader, that can be used as a drop-in replacement for the builtin Django cached template loader. It solves the described problem by refreshing each Djedi node on every template load.
To-do:
- [ ] Figure an elegant way to run tests using different template loaders
- [ ] Move the template loaders to a better place
- [ ] The lazy_tag decorator is no longer needed. We should probably deprecate it.
- [ ] Document the new cached loader.
Coverage remained the same when pulling 36d0d9d630d4c8f7854eaf79965e8b2d1f384b7f on kjagiello:cached-loader into e73bf0c2a8c04dd39fe1fd7dda60f69499efb683 on 5monkeys:master.
This looks very promising @kjagiello! Will do some testing and benchmarking.