orf / django-debug-toolbar-template-timings

A django-debug-toolbar panel that displays template rendering times for your Django application
https://pypi.python.org/pypi/django-debug-toolbar-template-timings
MIT License
296 stars 28 forks source link

Update TemplateTimings.py #25

Closed iho closed 8 years ago

iho commented 8 years ago

Hi!

I am trying work under django 1.9

from django.template import base as template_base

def _tag_compiler(func):

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        if 'node_class' in kwargs:
            wrap_generic_node(kwargs['node_class'], kwargs['name'])
            FOUND_GENERIC_NODES.add((kwargs['node_class'], kwargs['name']))
        return func(*args, **kwargs)

    return wrapper

template_base.generic_tag_compiler = _tag_compiler(
    template_base.generic_tag_compiler)

Do u even use this code?

bashu commented 8 years ago

+1

karyon commented 8 years ago

@orf ping. if i understand correctly, they asked whether that code is used because django.template.base.generic_tag_compiler got removed/refactored here and that line doesn't work anymore.

karyon commented 8 years ago

@orf sorry if i was unclear, i think this still won't work in django 1.9 because of the generic_tag_compiler stuff that got refactored.

orf commented 8 years ago

Sorry, I've rather dropped the ball on this project. I've merged this request and pushed a new release to PyPi, but I'm unsure if it actually works still. I think I'm going to do a full re-write at some point to attempt to support both Django and Jinja2 templates, but I currently don't use any templates for my work so I'm not sure where I will get the time.