universityScholarship.py 672 Bytes
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
from django.db import models
2
from backend.models.university import University
3
from backend.models.module import Scholarship, ScholarshipSerializer, ScholarshipViewSet
Florent Chehab's avatar
Florent Chehab committed
4
5
6


class UniversityScholarship(Scholarship):
Florent Chehab's avatar
Florent Chehab committed
7
8
9
10
    university = models.ForeignKey(
        University, on_delete=models.PROTECT, null=False, related_name="univScholarship")


11
class UniversityScholarshipSerializer(ScholarshipSerializer):
Florent Chehab's avatar
Florent Chehab committed
12
13
14

    class Meta:
        model = UniversityScholarship
Florent Chehab's avatar
Florent Chehab committed
15
        fields = '__all__'
Florent Chehab's avatar
Florent Chehab committed
16
17


18
class UniversityScholarshipViewSet(ScholarshipViewSet):
Florent Chehab's avatar
Florent Chehab committed
19
20
    queryset = UniversityScholarship.objects.all()  # pylint: disable=E1101
    serializer_class = UniversityScholarshipSerializer