"""
Panels for django-debug-toolbar
"""
from datetime import timedelta

from debug_toolbar.panels import Panel
from debug_toolbar.utils import ThreadCollector
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import gettext_lazy as _

from fluent_contents.extensions import PluginNotFound
from fluent_contents.models import ContentItem
from fluent_contents.rendering.core import RenderingPipe, ResultTracker
from fluent_contents.rendering.utils import get_placeholder_debug_name

collector = ThreadCollector()


class DebugResultTracker(ResultTracker):
    """
    Hook into the rendering pipeline to receive updates
    """

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # Reference this result in the data collector.
        collector.collect(self)
        # Track that the object was never cachable
        self.initial_all_cachable = self.all_cacheable

Example #2
0
 def __init__(self):
     ThreadCollector.__init__(self)
     self.enabled = False