from django.shortcuts import render
from django.shortcuts import get_object_or_404
from .models import Lottery, DrawResult


def view_draw_results(request, lottery_id):
    lottery = get_object_or_404(Lottery, id=lottery_id)
    draw_results = lottery.draw_results.all()
    return render(request, "admin/draw_result.html", {
        "lottery": lottery,
        "draw_results": draw_results
    })