mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-16 18:36:18 +00:00
added notification when admin adds a new article
This commit is contained in:
@ -70,7 +70,7 @@ def get_junior_leaderboard_rank(junior_obj):
|
||||
:param junior_obj:
|
||||
:return: junior's position/rank
|
||||
"""
|
||||
queryset = JuniorPoints.objects.prefetch_related('junior', 'junior__auth').annotate(rank=Window(
|
||||
queryset = JuniorPoints.objects.select_related('junior', 'junior__auth').annotate(rank=Window(
|
||||
expression=Rank(),
|
||||
order_by=[F('total_points').desc(), 'junior__created_at']
|
||||
)).order_by('-total_points', 'junior__created_at')
|
||||
|
Reference in New Issue
Block a user