from unfold.components import BaseComponent, register_component from django.template.loader import render_to_string from .user import * from .location import * from .notification import * from .verification import * @register_component class AllUserComponent(BaseComponent): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["children"] = render_to_string( "admin/helpers/kpi_progress.html", { "total": User.objects.filter(is_active=True).count(), }, ) return context @register_component class GuestUserComponent(BaseComponent): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) context["children"] = render_to_string( "admin/helpers/kpi_progress.html", { "total": User.objects.filter(email__isnull=True).count(), }, ) return context