countryScholarship.py 613 Bytes
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
from django.db import models
2
from backend.models.location import Country
3
from backend.models.module import Scholarship, ScholarshipSerializer, ScholarshipViewSet
Florent Chehab's avatar
Florent Chehab committed
4
5
6
7
8
9
10


class CountryScholarship(Scholarship):
    country = models.ManyToManyField(
        Country, related_name="country_scholarhip")


11
class CountryScholarshipSerializer(ScholarshipSerializer):
Florent Chehab's avatar
Florent Chehab committed
12
13
14
15
16
17

    class Meta:
        model = CountryScholarship
        fields = '__all__'


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