universityDri.py 638 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 DriRestrictedModule, DriRestrictedModuleSerializer, DriRestrictedModuleViewSet
Florent Chehab's avatar
Florent Chehab committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17


class UniversityDri(DriRestrictedModule):
    university = models.ManyToManyField(
        University, related_name="university_dri")


class UniversityDriSerializer(DriRestrictedModuleSerializer):

    class Meta:
        model = UniversityDri
        fields = '__all__'


18
class UniversityDriViewSet(DriRestrictedModuleViewSet):
Florent Chehab's avatar
Florent Chehab committed
19
20
    queryset = UniversityDri.objects.all()  # pylint: disable=E1101
    serializer_class = UniversityDriSerializer