Пример
urls.py
path('rating/',RatingsPage.as_view(),name='PlayerRating'),
views.py
class RatingsPage(UserInfo,View):
def get(self, request,*args, **kwargs): # level rank
uid = request.user.id
logic_data = super(RatingsPage, self)
user_stat_list = logic_data.UserStat(uid)
context = user_stat_list
select_user = UserAttribute.objects.all().order_by('-level')[0:20] #top20
context['ratings'] = select_user
return render(request,'ratings.html',context)
def Вызвать эту функцию в url(self, request,*args, **kwargs): # level rank
uid = request.user.id
logic_data = super(RatingsPage, self)
user_stat_list = logic_data.UserStat(uid)
context = user_stat_list
select_user = UserAttribute.objects.all().order_by('-level')[0:20] #top20
context['ratings'] = select_user
return render(request,'ratings.html',context)