from typing import Any from django.http import HttpRequest DASHBOARD_CARDS = {} def register(fragment): DASHBOARD_CARDS[fragment.name] = fragment return fragment class DashboardFragment: name: str template: str context: Any = None visible: bool = True def __init__(self, request: HttpRequest): self.request = request