from django import template
from ..models import CallbackRequest

register = template.Library()

@register.simple_tag
def get_unread_callbacks():
    return CallbackRequest.objects.filter(is_read=False).count()

@register.simple_tag
def get_today_callbacks():
    from django.utils import timezone
    today = timezone.now().date()
    return CallbackRequest.objects.filter(time_create__date=today).count()
