cmsmanage/dashboard/__init__.py

21 lines
360 B
Python
Raw Normal View History

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