from django_unicorn.components import UnicornView

from BasicData.models import Annee, MoyenneUe, Session


class MoyenneUeView(UnicornView):
    ue = None
    moyenne = None

    def mount(self):
        self.moyenne = MoyenneUe.objects.filter(etudiant=self.request.user, ue=self.ue, session=Session.objects.last(), annee=Annee.objects.last()).first()
