Reverse order

This commit is contained in:
Yohann D'ANELLO 2020-02-29 13:11:11 +01:00
parent b01ed31e45
commit a7df2411e0

View File

@ -13,8 +13,8 @@ class TombolaView(TemplateView):
context['title'] = "Tombola Saper[list]popette"
next_rewards = Reward.objects.filter(rewarded_by__isnull=True).order_by('order')
old_reward = Reward.objects.filter(rewarded_by__isnull=False).order_by('order')
next_rewards = Reward.objects.filter(rewarded_by__isnull=True).order_by('order').reverse()
old_reward = Reward.objects.filter(rewarded_by__isnull=False).order_by('order').reverse()
context['old_rewards'] = old_reward.all()
if old_reward.exists():
context['previous_reward'] = old_reward.last()