ticket and comment count and badge and new notif
This commit is contained in:
+10
-1
@@ -1,5 +1,8 @@
|
||||
from order.models import OrderModel
|
||||
from product.models import DollorModel
|
||||
from product.models import DollorModel, CommentModel
|
||||
from ticket.models import Ticket
|
||||
|
||||
|
||||
def admin_pending_count(request):
|
||||
pending_count = OrderModel.objects.filter(status='ADMIN_PENDING').count()
|
||||
return str(pending_count)
|
||||
@@ -7,3 +10,9 @@ def admin_pending_count(request):
|
||||
def dollor_price(request):
|
||||
dollor_object, _ = DollorModel.objects.get_or_create(unique_filed='unique')
|
||||
return str(dollor_object.price)[:2]
|
||||
|
||||
def comment_count(request):
|
||||
return CommentModel.objects.all().count()
|
||||
|
||||
def new_ticket_count(request):
|
||||
return Ticket.objects.filter(status__in=['open', 'in_progress']).count()
|
||||
Reference in New Issue
Block a user