You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

35 lines
1.0 KiB

from unfold.components import BaseComponent, register_component
from django.template.loader import render_to_string
from .user import *
from .location import *
from .login_history import *
from .notification import *
from .verification import *
from .role 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