From d8da6eaecf4a9f9668b3d1f49f618d6b892a03d3 Mon Sep 17 00:00:00 2001 From: arallaer Date: Thu, 29 Feb 2024 16:12:28 +0100 Subject: [PATCH 1/8] vak en lesgever views --- api/views/lesgever.py | 0 api/views/vak.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 api/views/lesgever.py create mode 100644 api/views/vak.py diff --git a/api/views/lesgever.py b/api/views/lesgever.py new file mode 100644 index 00000000..e69de29b diff --git a/api/views/vak.py b/api/views/vak.py new file mode 100644 index 00000000..e69de29b From c870730f7f231dcc59ef67fbd6c5238562f15773 Mon Sep 17 00:00:00 2001 From: arallaer Date: Thu, 29 Feb 2024 16:14:21 +0100 Subject: [PATCH 2/8] vak en lesgever views --- api/views/lesgever.py | 19 +++++++++++++++++++ api/views/vak.py | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/api/views/lesgever.py b/api/views/lesgever.py index e69de29b..6c04b2e3 100644 --- a/api/views/lesgever.py +++ b/api/views/lesgever.py @@ -0,0 +1,19 @@ +from django.http import JsonResponse +from rest_framework.decorators import api_view +from rest_framework.response import Response +from rest_framework import status +from ..models import Lesgever +from ..serializers import LesgeverSerializer + + +@api_view(['GET', 'POST']) +def lesgever_list(request): + if request.method == 'GET': + lesgevers = Lesgever.objects.all() + serializer = LesgeverSerializer(lesgevers, many=True) + return JsonResponse({'lesgevers': serializer.data}) + elif request.method == 'POST': + serializer = LesgeverSerializer(data=request.data) + if serializer.is_valid(): + serializer.save() + return Response(serializer.data, status=status.HTTP_201_CREATED) \ No newline at end of file diff --git a/api/views/vak.py b/api/views/vak.py index e69de29b..ddb6d873 100644 --- a/api/views/vak.py +++ b/api/views/vak.py @@ -0,0 +1,19 @@ +from django.http import JsonResponse +from rest_framework.decorators import api_view +from rest_framework.response import Response +from rest_framework import status +from ..models import Vak +from ..serializers import VakSerializer + + +@api_view(['GET', 'POST']) +def lesgever_list(request): + if request.method == 'GET': + lesgevers = Vak.objects.all() + serializer = VakSerializer(lesgevers, many=True) + return JsonResponse({'lesgevers': serializer.data}) + elif request.method == 'POST': + serializer = VakSerializer(data=request.data) + if serializer.is_valid(): + serializer.save() + return Response(serializer.data, status=status.HTTP_201_CREATED) \ No newline at end of file From 76783b0279e2c6270758851a18c0c908b860cf6f Mon Sep 17 00:00:00 2001 From: arallaer Date: Thu, 29 Feb 2024 16:54:16 +0100 Subject: [PATCH 3/8] opdelen models en serializers --- api/models.py | 68 ------------------- api/models/groep.py | 10 +++ api/models/indiening.py | 12 ++++ api/models/lesgever.py | 12 ++++ api/models/project.py | 15 +++++ api/models/score.py | 10 +++ api/models/student.py | 10 +++ api/models/vak.py | 12 ++++ api/serializers.py | 123 ----------------------------------- api/serializers/groep.py | 15 +++++ api/serializers/indiening.py | 15 +++++ api/serializers/lesgever.py | 17 +++++ api/serializers/project.py | 15 +++++ api/serializers/score.py | 15 +++++ api/serializers/student.py | 41 ++++++++++++ api/serializers/vak.py | 17 +++++ api/views/lesgever.py | 2 +- api/views/vak.py | 2 +- 18 files changed, 218 insertions(+), 193 deletions(-) delete mode 100644 api/models.py create mode 100644 api/models/groep.py create mode 100644 api/models/indiening.py create mode 100644 api/models/lesgever.py create mode 100644 api/models/project.py create mode 100644 api/models/score.py create mode 100644 api/models/student.py create mode 100644 api/models/vak.py delete mode 100644 api/serializers.py create mode 100644 api/serializers/groep.py create mode 100644 api/serializers/indiening.py create mode 100644 api/serializers/lesgever.py create mode 100644 api/serializers/project.py create mode 100644 api/serializers/score.py create mode 100644 api/serializers/student.py create mode 100644 api/serializers/vak.py diff --git a/api/models.py b/api/models.py deleted file mode 100644 index 48557de3..00000000 --- a/api/models.py +++ /dev/null @@ -1,68 +0,0 @@ -from django.db import models -from django.contrib.auth.models import User - - -class Student(models.Model): - user = models.OneToOneField(User, on_delete=models.CASCADE,primary_key=True,default=None) - subjects = models.ManyToManyField('Vak', related_name='students_enrolled') - - def __str__(self): - return self.user.first_name - -class Lesgever(models.Model): - lesgever_id = models.AutoField(primary_key=True) - name = models.CharField(max_length=100) - email = models.EmailField() - subjects = models.ManyToManyField('Vak', related_name='lesgevers_enrolled', blank=True) - is_admin = models.BooleanField(default=False) - - def __str__(self): - return self.name - -class Vak(models.Model): - vak_id = models.AutoField(primary_key=True) - name = models.CharField(max_length=100) - students = models.ManyToManyField('Student', related_name='subjects_enrolled', blank=True) - teachers = models.ManyToManyField('Lesgever', related_name='subjects_teachers') - projects = models.ManyToManyField('Project', related_name='subjects_projects', blank=True) - - def __str__(self): - return self.name - -class Groep(models.Model): - group_id = models.AutoField(primary_key=True) - students = models.ManyToManyField('Student', related_name='groups_students', blank=True) - project = models.ForeignKey('Project', on_delete=models.CASCADE) - - def __str__(self): - return f"Group {self.group_id}" - -class Project(models.Model): - project_id = models.AutoField(primary_key=True) - titel = models.CharField(max_length=100) - description = models.TextField() - opgavebestanden = models.FileField(upload_to='opgave/') - vak = models.ForeignKey(Vak, on_delete=models.CASCADE) - deadline = models.DateTimeField(null=True) - # indiening restricties - - def __str__(self): - return self.titel - -class Indiening(models.Model): - indiening_id = models.AutoField(primary_key=True) - indiener = models.ForeignKey('Groep', on_delete=models.CASCADE) - indieningsbestanden = models.FileField(upload_to='uploads/') - tijdstip = models.DateTimeField(null=False) - - def __str__(self): - return self.tijdstip - -class Score(models.Model): - score = models.SmallIntegerField() - indiening = models.ForeignKey('Indiening', on_delete=models.CASCADE) - groep = models.ForeignKey('Groep', on_delete=models.CASCADE) - - def __str__(self): - return self.score - diff --git a/api/models/groep.py b/api/models/groep.py new file mode 100644 index 00000000..f8105613 --- /dev/null +++ b/api/models/groep.py @@ -0,0 +1,10 @@ +from django.db import models + + +class Groep(models.Model): + group_id = models.AutoField(primary_key=True) + students = models.ManyToManyField('Student', related_name='groups_students', blank=True) + project = models.ForeignKey('Project', on_delete=models.CASCADE) + + def __str__(self): + return f"Group {self.group_id}" diff --git a/api/models/indiening.py b/api/models/indiening.py new file mode 100644 index 00000000..da4a7228 --- /dev/null +++ b/api/models/indiening.py @@ -0,0 +1,12 @@ +from django.db import models + + +class Indiening(models.Model): + indiening_id = models.AutoField(primary_key=True) + indiener = models.ForeignKey('Groep', on_delete=models.CASCADE) + indieningsbestanden = models.FileField(upload_to='uploads/') + tijdstip = models.DateTimeField(null=False) + + def __str__(self): + return self.tijdstip + \ No newline at end of file diff --git a/api/models/lesgever.py b/api/models/lesgever.py new file mode 100644 index 00000000..1a2f11bd --- /dev/null +++ b/api/models/lesgever.py @@ -0,0 +1,12 @@ +from django.db import models + + +class Lesgever(models.Model): + lesgever_id = models.AutoField(primary_key=True) + name = models.CharField(max_length=100) + email = models.EmailField() + subjects = models.ManyToManyField('Vak', related_name='lesgevers_enrolled', blank=True) + is_admin = models.BooleanField(default=False) + + def __str__(self): + return self.name \ No newline at end of file diff --git a/api/models/project.py b/api/models/project.py new file mode 100644 index 00000000..2fb1ebab --- /dev/null +++ b/api/models/project.py @@ -0,0 +1,15 @@ +from django.db import models +from vak import Vak + + +class Project(models.Model): + project_id = models.AutoField(primary_key=True) + titel = models.CharField(max_length=100) + description = models.TextField() + opgavebestanden = models.FileField(upload_to='opgave/') + vak = models.ForeignKey(Vak, on_delete=models.CASCADE) + deadline = models.DateTimeField(null=True) + # indiening restricties + + def __str__(self): + return self.titel diff --git a/api/models/score.py b/api/models/score.py new file mode 100644 index 00000000..0b6cc20d --- /dev/null +++ b/api/models/score.py @@ -0,0 +1,10 @@ +from django.db import models + + +class Score(models.Model): + score = models.SmallIntegerField() + indiening = models.ForeignKey('Indiening', on_delete=models.CASCADE) + groep = models.ForeignKey('Groep', on_delete=models.CASCADE) + + def __str__(self): + return self.score diff --git a/api/models/student.py b/api/models/student.py new file mode 100644 index 00000000..2771560e --- /dev/null +++ b/api/models/student.py @@ -0,0 +1,10 @@ +from django.db import models +from django.contrib.auth.models import User + + +class Student(models.Model): + user = models.OneToOneField(User, on_delete=models.CASCADE,primary_key=True,default=None) + subjects = models.ManyToManyField('Vak', related_name='students_enrolled') + + def __str__(self): + return self.user.first_name diff --git a/api/models/vak.py b/api/models/vak.py new file mode 100644 index 00000000..e4a55ade --- /dev/null +++ b/api/models/vak.py @@ -0,0 +1,12 @@ +from django.db import models + + +class Vak(models.Model): + vak_id = models.AutoField(primary_key=True) + name = models.CharField(max_length=100) + students = models.ManyToManyField('Student', related_name='subjects_enrolled', blank=True) + teachers = models.ManyToManyField('Lesgever', related_name='subjects_teachers') + projects = models.ManyToManyField('Project', related_name='subjects_projects', blank=True) + + def __str__(self): + return self.name diff --git a/api/serializers.py b/api/serializers.py deleted file mode 100644 index 62c2db83..00000000 --- a/api/serializers.py +++ /dev/null @@ -1,123 +0,0 @@ -from datetime import datetime -from rest_framework import serializers -from rest_framework.renderers import JSONRenderer -import io -from rest_framework.parsers import JSONParser - -from .models import Student, Lesgever, Vak, Groep, Project, Indiening, Score - -class StudentSerializer(serializers.ModelSerializer): - class Meta: - model = Student - fields = '__all__' - - def create(self, validated_data): - return Student.objects.create(**validated_data) - - def update(self, instance, validated_data): - # Update the regular fields - instance.name = validated_data.get('name', instance.name) - instance.email = validated_data.get('email', instance.email) - # Update the subjects list - subjects_data = validated_data.pop('subjects', None) - if subjects_data is not None: - instance.subjects.clear() # Remove existing subjects - for subject_data in subjects_data: - instance.subjects.add(subject_data) - - instance.save() - return instance - -class LesgeverSerializer(serializers.ModelSerializer): - class Meta: - model = Lesgever - fields = '__all__' - - def create(self, validated_data): - return Lesgever.objects.create(**validated_data) - - def update(self, instance, validated_data): - instance.name = validated_data.get('name', instance.name) - # Update other fields similarly - instance.save() - return instance - -class VakSerializer(serializers.ModelSerializer): - class Meta: - model = Vak - fields = '__all__' - - def create(self, validated_data): - return Vak.objects.create(**validated_data) - - def update(self, instance, validated_data): - instance.name = validated_data.get('name', instance.name) - # Update other fields similarly - instance.save() - return instance - -class GroepSerializer(serializers.ModelSerializer): - class Meta: - model = Groep - fields = '__all__' - - def create(self, validated_data): - return Groep.objects.create(**validated_data) - - def update(self, instance, validated_data): - # Implement update method for Groep model - pass - -class ProjectSerializer(serializers.ModelSerializer): - class Meta: - model = Project - fields = '__all__' - - def create(self, validated_data): - return Project.objects.create(**validated_data) - - def update(self, instance, validated_data): - # Implement update method for Project model - pass - -class IndieningSerializer(serializers.ModelSerializer): - class Meta: - model = Indiening - fields = '__all__' - - def create(self, validated_data): - return Indiening.objects.create(**validated_data) - - def update(self, instance, validated_data): - # Implement update method for Indiening model - pass - -class ScoreSerializer(serializers.ModelSerializer): - class Meta: - model = Score - fields = '__all__' - - def create(self, validated_data): - return Score.objects.create(**validated_data) - - def update(self, instance, validated_data): - # Implement update method for Score model - pass - - - -# gebruiksvoorbeelden - -# serializing objects -#serializer = ProfSerializer(prof) -#serializer.data -#json = JSONRenderer().render(serializer.data) -#json - -#deserializing objects -#stream = io.BytesIO(json) -#data = JSONParser().parse(stream) -#serializer = ProfSerializer(data=data) -#serializer.is_valid() -#serializer.validated_data -#serializer.save() diff --git a/api/serializers/groep.py b/api/serializers/groep.py new file mode 100644 index 00000000..f2c53ef1 --- /dev/null +++ b/api/serializers/groep.py @@ -0,0 +1,15 @@ +from rest_framework import serializers +from api.models import Groep + + +class GroepSerializer(serializers.ModelSerializer): + class Meta: + model = Groep + fields = '__all__' + + def create(self, validated_data): + return Groep.objects.create(**validated_data) + + def update(self, instance, validated_data): + # Implement update method for Groep model + pass diff --git a/api/serializers/indiening.py b/api/serializers/indiening.py new file mode 100644 index 00000000..1982fa35 --- /dev/null +++ b/api/serializers/indiening.py @@ -0,0 +1,15 @@ +from rest_framework import serializers +from api.models import Indiening + + +class IndieningSerializer(serializers.ModelSerializer): + class Meta: + model = Indiening + fields = '__all__' + + def create(self, validated_data): + return Indiening.objects.create(**validated_data) + + def update(self, instance, validated_data): + # Implement update method for Indiening model + pass diff --git a/api/serializers/lesgever.py b/api/serializers/lesgever.py new file mode 100644 index 00000000..c79df710 --- /dev/null +++ b/api/serializers/lesgever.py @@ -0,0 +1,17 @@ +from rest_framework import serializers +from api.models import Lesgever + + +class LesgeverSerializer(serializers.ModelSerializer): + class Meta: + model = Lesgever + fields = '__all__' + + def create(self, validated_data): + return Lesgever.objects.create(**validated_data) + + def update(self, instance, validated_data): + instance.name = validated_data.get('name', instance.name) + # Update other fields similarly + instance.save() + return instance diff --git a/api/serializers/project.py b/api/serializers/project.py new file mode 100644 index 00000000..c63e4188 --- /dev/null +++ b/api/serializers/project.py @@ -0,0 +1,15 @@ +from rest_framework import serializers +from api.models import Student, Lesgever, Vak, Groep, Project, Indiening, Score + + +class ProjectSerializer(serializers.ModelSerializer): + class Meta: + model = Project + fields = '__all__' + + def create(self, validated_data): + return Project.objects.create(**validated_data) + + def update(self, instance, validated_data): + # Implement update method for Project model + pass diff --git a/api/serializers/score.py b/api/serializers/score.py new file mode 100644 index 00000000..24a9f88e --- /dev/null +++ b/api/serializers/score.py @@ -0,0 +1,15 @@ +from rest_framework import serializers +from api.models import Score + + +class ScoreSerializer(serializers.ModelSerializer): + class Meta: + model = Score + fields = '__all__' + + def create(self, validated_data): + return Score.objects.create(**validated_data) + + def update(self, instance, validated_data): + # Implement update method for Score model + pass diff --git a/api/serializers/student.py b/api/serializers/student.py new file mode 100644 index 00000000..9ba878f0 --- /dev/null +++ b/api/serializers/student.py @@ -0,0 +1,41 @@ +from rest_framework import serializers +from api.models import Student + + +class StudentSerializer(serializers.ModelSerializer): + class Meta: + model = Student + fields = '__all__' + + def create(self, validated_data): + return Student.objects.create(**validated_data) + + def update(self, instance, validated_data): + # Update the regular fields + instance.name = validated_data.get('name', instance.name) + instance.email = validated_data.get('email', instance.email) + # Update the subjects list + subjects_data = validated_data.pop('subjects', None) + if subjects_data is not None: + instance.subjects.clear() # Remove existing subjects + for subject_data in subjects_data: + instance.subjects.add(subject_data) + + instance.save() + return instance + +# gebruiksvoorbeelden + +# serializing objects +#serializer = ProfSerializer(prof) +#serializer.data +#json = JSONRenderer().render(serializer.data) +#json + +#deserializing objects +#stream = io.BytesIO(json) +#data = JSONParser().parse(stream) +#serializer = ProfSerializer(data=data) +#serializer.is_valid() +#serializer.validated_data +#serializer.save() diff --git a/api/serializers/vak.py b/api/serializers/vak.py new file mode 100644 index 00000000..3a1c8bac --- /dev/null +++ b/api/serializers/vak.py @@ -0,0 +1,17 @@ +from rest_framework import serializers +from api.models import Vak + + +class VakSerializer(serializers.ModelSerializer): + class Meta: + model = Vak + fields = '__all__' + + def create(self, validated_data): + return Vak.objects.create(**validated_data) + + def update(self, instance, validated_data): + instance.name = validated_data.get('name', instance.name) + # Update other fields similarly + instance.save() + return instance \ No newline at end of file diff --git a/api/views/lesgever.py b/api/views/lesgever.py index 6c04b2e3..8883c4b6 100644 --- a/api/views/lesgever.py +++ b/api/views/lesgever.py @@ -16,4 +16,4 @@ def lesgever_list(request): serializer = LesgeverSerializer(data=request.data) if serializer.is_valid(): serializer.save() - return Response(serializer.data, status=status.HTTP_201_CREATED) \ No newline at end of file + return Response(serializer.data, status=status.HTTP_201_CREATED) diff --git a/api/views/vak.py b/api/views/vak.py index ddb6d873..6f38ecce 100644 --- a/api/views/vak.py +++ b/api/views/vak.py @@ -16,4 +16,4 @@ def lesgever_list(request): serializer = VakSerializer(data=request.data) if serializer.is_valid(): serializer.save() - return Response(serializer.data, status=status.HTTP_201_CREATED) \ No newline at end of file + return Response(serializer.data, status=status.HTTP_201_CREATED) From 6e5438150c8706b14fc07488cbabb2af5527b0bb Mon Sep 17 00:00:00 2001 From: arallaer Date: Thu, 29 Feb 2024 16:58:45 +0100 Subject: [PATCH 4/8] fix imports --- api/views/lesgever.py | 4 ++-- api/views/student.py | 4 ++-- api/views/vak.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/views/lesgever.py b/api/views/lesgever.py index 8883c4b6..2251e691 100644 --- a/api/views/lesgever.py +++ b/api/views/lesgever.py @@ -2,8 +2,8 @@ from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework import status -from ..models import Lesgever -from ..serializers import LesgeverSerializer +from api.models import Lesgever +from api.serializers import LesgeverSerializer @api_view(['GET', 'POST']) diff --git a/api/views/student.py b/api/views/student.py index 7ced2f1d..8026c53d 100644 --- a/api/views/student.py +++ b/api/views/student.py @@ -4,8 +4,8 @@ from rest_framework import status -from ..models import Student -from ..serializers import StudentSerializer +from api.models import Student +from api.serializers import StudentSerializer from ..utils import json_error diff --git a/api/views/vak.py b/api/views/vak.py index 6f38ecce..4fb92aef 100644 --- a/api/views/vak.py +++ b/api/views/vak.py @@ -2,8 +2,8 @@ from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework import status -from ..models import Vak -from ..serializers import VakSerializer +from api.models import Vak +from api.serializers import VakSerializer @api_view(['GET', 'POST']) From e5668e33e56511a302949fe39085d2f7c5461c41 Mon Sep 17 00:00:00 2001 From: Robbe Date: Fri, 1 Mar 2024 11:28:36 +0100 Subject: [PATCH 5/8] fixed imports --- api/__pycache__/__init__.cpython-310.pyc | Bin 129 -> 133 bytes api/__pycache__/settings.cpython-310.pyc | Bin 2411 -> 3128 bytes api/__pycache__/urls.cpython-310.pyc | Bin 1224 -> 1220 bytes api/__pycache__/utils.cpython-310.pyc | Bin 756 -> 1048 bytes api/__pycache__/wsgi.cpython-310.pyc | Bin 524 -> 528 bytes api/admin.py | 11 ++++++++--- api/models/project.py | 2 +- api/serializers/groep.py | 4 ++-- api/serializers/indiening.py | 4 ++-- api/serializers/lesgever.py | 2 +- api/serializers/project.py | 4 ++-- api/serializers/score.py | 2 +- api/serializers/student.py | 2 +- api/serializers/vak.py | 4 ++-- api/views/lesgever.py | 4 ++-- api/views/student.py | 8 ++++---- api/views/vak.py | 4 ++-- 17 files changed, 28 insertions(+), 23 deletions(-) diff --git a/api/__pycache__/__init__.cpython-310.pyc b/api/__pycache__/__init__.cpython-310.pyc index 7b18139c29d043cfc1f1b6629b11bf72182cae82..9ab1828b2835f521d2da609259e805997cdbbe37 100644 GIT binary patch delta 39 tcmZoTk2x#bMdO3xG4&xmoO6R3Y8^;k_u!GC1}lBrb3Yh zB_)V1LXrM~LO@S0Uu(W30D%fXK=epYq#}t}@+2yul|8wapa~+d#9INi z$dtF_EO{<;)vii4NYE50G~E#(`Hs*GS{3a$i=ZLQK#Jxd3M&u=v+syYVCGcr5SoV^ zy#aZ+0kbd%H{lk{!@{ZJ5;_Y7Sj4;n+>Z5~STDJxBhxv!OK-w5y@kup1~%BhPL~2;&!@i8{I&Er`>7Xn zTz{0?iLD)8_Pn@0`7v3@ib0<%(-#m*7w?l28OtZm;F!zZ!1Z~$(KMQsl5N%NO|EoU z^isk#yqa)5QjelbQjD_QvZ`D&TFozQqx?mKFGPras+92Wdd+@rl)f@+;AL3a~$;8P8b{>vK@StlRwnWrSC8z3z>{cGDH#c slAM$!Ra6sdMov#Qv}ap0VoFL86j78#awYP=qIAW|-(pVwPnK2kKR7){AOHXW delta 406 zcmYk2J5K^p5QXpDd-uV@@>pP(r&t&Rg~8s20$Upsi)jcjE02H}u&1!G-^9XD0ELP5 zHvRxhTN^AbjmFx_3zd_c@8o1AnaMooKAri*wk@VgIPX5%jD2jw|1wo*D9v6Jh#?~& zK7uhv4$SAixP_%$v7t89P$z)~Ni<0#y~i=qV`QuWE#;>2C`B+v+axKf7+cR_0Aw#@ z574GK#wkHbN|8fp(kVmPg+2gGkV~GLb1AoDe#gQ9dJ>aV#1xg#QESsm87gCz_Rv*l zRz@CrzBkM*^S(~y6~_Wq&RK20T?NLh=CFMgUcxa1kNhBaoxV@j|QD755FS<1fR@;A1j}KV$-^M)(*c1 o_5Nh+*Ju8y-3jiZRrf-*B#Xt8LK;$-+|)yKLo5=P5=M^ diff --git a/api/__pycache__/urls.cpython-310.pyc b/api/__pycache__/urls.cpython-310.pyc index f68b2c87c3c542963af61293d1d85ac3e61d6833..bdf83ddb64bc70fcc93ec5a65e281ecbe8b2e1b4 100644 GIT binary patch delta 337 zcmXX=Jx{|h6pWL!`Dk2~0XBw8AXHHrQ86$e)-tgmB-F)f<419o#Fg!UV9hV6vNEzV z@Ec&@H+bSFFvEfq`kr)mdZ*L9&)_4#9OKY3^G?2Cvc|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`VlzvE~ygjxjLnNShX5>-O&&bbB)h|xXNlco2kI@JKr9KK& diff --git a/api/admin.py b/api/admin.py index db5e1238..5e85ceb9 100644 --- a/api/admin.py +++ b/api/admin.py @@ -1,6 +1,11 @@ from django.contrib import admin -from .models import * - +from .models.student import * +from .models.lesgever import * +from .models.vak import * +from .models.groep import * +from .models.project import * +from .models.indiening import * +from .models.score import * admin.site.register(Student) admin.site.register(Lesgever) @@ -8,4 +13,4 @@ admin.site.register(Groep) admin.site.register(Project) admin.site.register(Indiening) -admin.site.register(Score) \ No newline at end of file +admin.site.register(Score) diff --git a/api/models/project.py b/api/models/project.py index 2fb1ebab..010e92e6 100644 --- a/api/models/project.py +++ b/api/models/project.py @@ -1,5 +1,5 @@ from django.db import models -from vak import Vak +from .vak import Vak class Project(models.Model): diff --git a/api/serializers/groep.py b/api/serializers/groep.py index f2c53ef1..fa686aa7 100644 --- a/api/serializers/groep.py +++ b/api/serializers/groep.py @@ -1,12 +1,12 @@ from rest_framework import serializers -from api.models import Groep +from api.models.groep import Groep class GroepSerializer(serializers.ModelSerializer): class Meta: model = Groep fields = '__all__' - + def create(self, validated_data): return Groep.objects.create(**validated_data) diff --git a/api/serializers/indiening.py b/api/serializers/indiening.py index 1982fa35..e33f3f8d 100644 --- a/api/serializers/indiening.py +++ b/api/serializers/indiening.py @@ -1,12 +1,12 @@ from rest_framework import serializers -from api.models import Indiening +from api.models.indiening import Indiening class IndieningSerializer(serializers.ModelSerializer): class Meta: model = Indiening fields = '__all__' - + def create(self, validated_data): return Indiening.objects.create(**validated_data) diff --git a/api/serializers/lesgever.py b/api/serializers/lesgever.py index c79df710..5b9c3062 100644 --- a/api/serializers/lesgever.py +++ b/api/serializers/lesgever.py @@ -1,5 +1,5 @@ from rest_framework import serializers -from api.models import Lesgever +from api.models.lesgever import Lesgever class LesgeverSerializer(serializers.ModelSerializer): diff --git a/api/serializers/project.py b/api/serializers/project.py index c63e4188..541bb701 100644 --- a/api/serializers/project.py +++ b/api/serializers/project.py @@ -1,12 +1,12 @@ from rest_framework import serializers -from api.models import Student, Lesgever, Vak, Groep, Project, Indiening, Score +from api.models.project import Student, Lesgever, Vak, Groep, Project, Indiening, Score class ProjectSerializer(serializers.ModelSerializer): class Meta: model = Project fields = '__all__' - + def create(self, validated_data): return Project.objects.create(**validated_data) diff --git a/api/serializers/score.py b/api/serializers/score.py index 24a9f88e..4daacc12 100644 --- a/api/serializers/score.py +++ b/api/serializers/score.py @@ -1,5 +1,5 @@ from rest_framework import serializers -from api.models import Score +from api.models.score import Score class ScoreSerializer(serializers.ModelSerializer): diff --git a/api/serializers/student.py b/api/serializers/student.py index 9ba878f0..d4c8a7bc 100644 --- a/api/serializers/student.py +++ b/api/serializers/student.py @@ -1,5 +1,5 @@ from rest_framework import serializers -from api.models import Student +from api.models.student import Student class StudentSerializer(serializers.ModelSerializer): diff --git a/api/serializers/vak.py b/api/serializers/vak.py index 3a1c8bac..f88a0536 100644 --- a/api/serializers/vak.py +++ b/api/serializers/vak.py @@ -1,5 +1,5 @@ from rest_framework import serializers -from api.models import Vak +from api.models.vak import Vak class VakSerializer(serializers.ModelSerializer): @@ -14,4 +14,4 @@ def update(self, instance, validated_data): instance.name = validated_data.get('name', instance.name) # Update other fields similarly instance.save() - return instance \ No newline at end of file + return instance diff --git a/api/views/lesgever.py b/api/views/lesgever.py index 2251e691..0830d29c 100644 --- a/api/views/lesgever.py +++ b/api/views/lesgever.py @@ -2,8 +2,8 @@ from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework import status -from api.models import Lesgever -from api.serializers import LesgeverSerializer +from api.models.lesgever import Lesgever +from api.serializers.lesgever import LesgeverSerializer @api_view(['GET', 'POST']) diff --git a/api/views/student.py b/api/views/student.py index 8026c53d..8f2635bd 100644 --- a/api/views/student.py +++ b/api/views/student.py @@ -4,8 +4,8 @@ from rest_framework import status -from api.models import Student -from api.serializers import StudentSerializer +from api.models.student import Student +from api.serializers.student import StudentSerializer from ..utils import json_error @@ -26,6 +26,6 @@ def student_list(request): students = Student.objects.all() serializer = StudentSerializer(students, many=True) return JsonResponse({'studenten': serializer.data}) - + else: - return json_error('no_perm')""" \ No newline at end of file + return json_error('no_perm')""" diff --git a/api/views/vak.py b/api/views/vak.py index 4fb92aef..1bec5a1f 100644 --- a/api/views/vak.py +++ b/api/views/vak.py @@ -2,8 +2,8 @@ from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework import status -from api.models import Vak -from api.serializers import VakSerializer +from api.models.vak import Vak +from api.serializers.vak import VakSerializer @api_view(['GET', 'POST']) From 5f167854b09a77281f1987469d4cd21efb681efa Mon Sep 17 00:00:00 2001 From: arallaer Date: Sat, 2 Mar 2024 22:28:07 +0100 Subject: [PATCH 6/8] fix gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 226d404f..f68c13ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules projectenv /venv/ -__pycache__ +**/__pycache__/ migrations +.env \ No newline at end of file From b6a1929ea4838dbdb28d50f5c802b4eb91842e26 Mon Sep 17 00:00:00 2001 From: arallaer Date: Sat, 2 Mar 2024 22:45:15 +0100 Subject: [PATCH 7/8] geen gitignore files meer --- api/.env | 5 ----- api/__pycache__/__init__.cpython-310.pyc | Bin 133 -> 0 bytes api/__pycache__/admin.cpython-311.pyc | Bin 873 -> 0 bytes api/__pycache__/middleware.cpython-311.pyc | Bin 1323 -> 0 bytes api/__pycache__/models.cpython-310.pyc | Bin 3337 -> 0 bytes api/__pycache__/serializers.cpython-311.pyc | Bin 845 -> 0 bytes api/__pycache__/settings.cpython-310.pyc | Bin 3128 -> 0 bytes api/__pycache__/urls.cpython-310.pyc | Bin 1220 -> 0 bytes api/__pycache__/utils.cpython-310.pyc | Bin 1048 -> 0 bytes api/__pycache__/views.cpython-310.pyc | Bin 1030 -> 0 bytes api/__pycache__/wsgi.cpython-310.pyc | Bin 528 -> 0 bytes api/views/__pycache__/student.cpython-311.pyc | Bin 1540 -> 0 bytes api/views/__pycache__/views.cpython-311.pyc | Bin 967 -> 0 bytes 13 files changed, 5 deletions(-) delete mode 100644 api/.env delete mode 100644 api/__pycache__/__init__.cpython-310.pyc delete mode 100644 api/__pycache__/admin.cpython-311.pyc delete mode 100644 api/__pycache__/middleware.cpython-311.pyc delete mode 100644 api/__pycache__/models.cpython-310.pyc delete mode 100644 api/__pycache__/serializers.cpython-311.pyc delete mode 100644 api/__pycache__/settings.cpython-310.pyc delete mode 100644 api/__pycache__/urls.cpython-310.pyc delete mode 100644 api/__pycache__/utils.cpython-310.pyc delete mode 100644 api/__pycache__/views.cpython-310.pyc delete mode 100644 api/__pycache__/wsgi.cpython-310.pyc delete mode 100644 api/views/__pycache__/student.cpython-311.pyc delete mode 100644 api/views/__pycache__/views.cpython-311.pyc diff --git a/api/.env b/api/.env deleted file mode 100644 index 8b478692..00000000 --- a/api/.env +++ /dev/null @@ -1,5 +0,0 @@ -client_id='239ce609-e362-4cf6-919f-97e6935ef5f5' -client_secret='Eyv8Q~PoW8FW_y3Wdprc~HdCQg6whiIz8wi0ddbm' -tenant_id='d7811cde-ecef-496c-8f91-a1786241b99c' - -ad_url='https://login.microsoftonline.com/d7811cde-ecef-496c-8f91-a1786241b99c/oauth2/v2.0/token?' \ No newline at end of file diff --git a/api/__pycache__/__init__.cpython-310.pyc b/api/__pycache__/__init__.cpython-310.pyc deleted file mode 100644 index 9ab1828b2835f521d2da609259e805997cdbbe37..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 133 zcmd1j<>g`kg4yv8QbF`%5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!H9enx(7s(w*^ zQc|jZacYi{eyDqDUWu-WequqUetdjpUS>&ryk0@&Ee@O9{FKt1R6CFf#Y{kgg#iH8 ClN%)f diff --git a/api/__pycache__/admin.cpython-311.pyc b/api/__pycache__/admin.cpython-311.pyc deleted file mode 100644 index 09a05a6c11f0fc056ead0a0191bd42fb3f99a2cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 873 zcmbV}zfaph6vy9@I0*qd@I#8CBw`IxIf-^chyjYyRQ!?*3~a{tnmVz4(b++;qt0xs zOrWZNM|ZojM05iS6B`m61L6z>+=>DD>D{mI-RIrCcjsecMNqade~I^MyowhC%REnR ze-eNbV8DnC4%sCH*bvLuLtB8PJvarY*#VdwQ9D!gZ`GcRyobr9VDc%LLJDR$1yfAH zjQr2AtPXYUIxb_KNX=l5tY`Ts z3j$k~=cAB$-S07UeOXvVuZ8+RcZCJ@%ASpjVp4^Ulk)zk?j}PB>BDsJulHdp82C*NNbab30TX{=;empe5mW=HCe`H-N)eO-C?(aE5Xuph11Klex8pWLs6|i6i{K0|IzfQpsK%fS7P~&vC4{8aW zqng(fl${S|R|iy&ZO7iR9FMFKgqICnH_oF3i-=VIoderTSF`Hqi zA7=cA>%PRsc`pCvS!bqrmXkX<*-y(~v$@aN!l!KEcDb0!D;G?uTk|Lgy+J1Fe`hg1PVxrs=fH@aZr$YAXZ~Z;Z6@+ zRuLUzsz}Kor8iZ(?i4l0-iYcuIanbL2fLc*lCbu%qlZm`+4WH{(+si1!T^7X^HDyJ u@C~}g`jJ>v^%4-mE-3h;qYG~PqoWIE{n63mQ;_CyS^Z#ZKmW23hVvWEb2`ER diff --git a/api/__pycache__/models.cpython-310.pyc b/api/__pycache__/models.cpython-310.pyc deleted file mode 100644 index 0ad404b01b43429cbd1268f1d2f7238d55c6be76..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3337 zcmbuBTW{P%6vyqo`LfH?(pJkg@cXm%JC}}O z{6ROze>L2!;gUbYFoT(~F)@A9G;SEI!m5u9R^{ei<)^A&g{Q{q@YD-W4W0(G;IRr% z9UhxG@HmC10gua?@H7jL1&_yC@U#k#4NseO;OP_|hjshLnU$wllX1q(8|WlOCDHvEf6CBzWQqp<^6C%azP}>%Q!?O*NaL8ZBQy5| zkHd_!APFaYWMc6AM{T+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K2Jp{u=4M>G1pR=v|cq5#K9w$KRA zHJQ0p=~cO}JprJSS~H%?ttK!#&?3q$xqaN1j{)FL15QnA0@iv5%2WjCjpp8?HqA3i z(;;#VEZ3QLda?E6Coj_2Dxx+&!p4?|c7QBu!>i{3F!O)W+Y#$7Ck>GYmpzbyeh6xjes-6$(OD z83wg4$IjGq;8~b3@f-)fIx^{Rze(rz4Q{&*lk^6JF;Dt?RB4q z=in`JLgKWq02jt?iYg=|aFmHX9e?x9=W*p=5PLAbX5Z*}=y~7mVt+)icm}UFV2C&M zh);sj=fO1a?YvdCcsLDtd)kI|NZMtGN7IORr(L)1lm|SX#=b{G64B@;fNz%utKO>b z<_EM*;v3)1d$jAmeHz~ci}rLt2JgINm~R5li!a~4Muik}wpgp&Fe%VnDwJ0YRZ6aC zVbVB$zoh8HT9s993{^sZKqb=#DY-UOBS6r|Nc4%(E1jY<*v_S*hzUUATg*8i}v@oBCz3v!(N!RSI1<(e?D z01;e1Tbe!Hojw;%7z9+{cx)^^PSCuOad-1)M@{stZ+{NzBhCsXwVay_)RqNv4OI^Tiiu27!W1+q z;PkbDa)iljZ*FjUMay#hQOGNSe?yF!jbP?_yoZ&pv=p0;qk%V(%-3dliZ@4F9WuMj zax&MBxw02`Gl2Vnn|xHfNrrWlWzfr6Ru3EbKy{fWBFss$be{|VsUUKwXq z$GRl+N+iTP>p1NZR^=TPtXA+~(& k-n6=|yN|gf>ykdT3hTRILa%>#=pP1szuW5jVD0ns7pNY2o&W#< diff --git a/api/__pycache__/utils.cpython-310.pyc b/api/__pycache__/utils.cpython-310.pyc deleted file mode 100644 index 725534abf4e4a1a0214b4b1944b706b3aceff011..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1048 zcmYil%Wl+2upb`Vnar?J4rCDsc~{H9Xfu{poDf2bk_drNR+4FvhEK{8I%BuXxv!z}Z8jGC%cQp>3sm9oi30;a{H zHfdn{_>QK=`P;bkQwck~WHq2uV|%)k9i-fHOwdMiC7oG*S$EiRtX;FUK$J z#@>r(2ZzV`vwb_fWRDK^#s|kXR`6y4+Ms18wXuOOD^LS8S3^f`I7g^jT+Fp zn1Sk{P0E$~cWiht9{({uvK;fmb?e$+^@sNu1zRBs^}kO7S;*^2o-9qT6Hs%-j&|~=I zK5P_GoT3c-7;9{$R%ZLQ!8TyWcMNvYN>=r&fGf261^G2vqb{5-tmpoR)Xdz*d$d37E*4*dgF{32ONhrxBCbPwR^%*GgXjC*;DDvw;BbfK zs=X0FZo$Wd9m`H}Qm)CV78_5~^kkHpOh-xX0*%y)tIoP5mI3_J7u_R$Yx=SRK*1DI zi`oeu;{=FjQ|H;7n&eb8pTez(05#r^i+ z{vd7-9<^qc*9Ht6a+Y*@N+Mn)?ZWw__tCo6#REI8qSuo6EcCZC4#}QLZNMVAa3bR*ME-LfeFZ0!DonEEHoar8vZgp3iC1V$O#uJ znkp$YTe)!U*3r#Gh$^`KI<%xSRWOZLv!bON%_iO)si8MHyALx?rzv}+dm**oLmu`l K54*POdiHNd|NF`S diff --git a/api/__pycache__/wsgi.cpython-310.pyc b/api/__pycache__/wsgi.cpython-310.pyc deleted file mode 100644 index 6e1b6f0627b940a36768c96c6c38de1c5f341ad3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 528 zcmYk3!EO^V5Qe>*v?)uAI3UhGaEV0M6@m*w6-X^nDw-bB3Mm)ISx+{Oyq?wCO=&M2 zcnmIZ?DKH*38^PuffKWdkTQ~OjmIdZ}EA|CtJ`1UT^~KN1VP z2`Dtw7H=zXLEQM#i0luwf{pq~d{#n`?Va4hh|f>XK8ywza(sGuIUEhf^8DiD>eK1n zKK(rR5Q1@~@AqO)N|Ki{rs(6-4MbiLd)}68QWA+ha4XZGiy0+qn5%0W;^Qr~d)BlA zTyKA05OD>f!PyLi2m4A~4G8=2wIJy=d|uziy?2|I9@D&;Z?n5>@6mqxB+b%)FtedT diff --git a/api/views/__pycache__/student.cpython-311.pyc b/api/views/__pycache__/student.cpython-311.pyc deleted file mode 100644 index 8903957e6c108511f8e23ea6acd8c4ff869dcfa4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1540 zcmZWp-EZ4e6u;L_>?C&D4HG`vCQ2m~HGI@i3Q`FI0Snzm)=W(hQV@!~_-;*V$Kl%P zHq@d$OejJ~@PM>F@X)8SsgdA?2mTAEinPd55fV>(K|y`n6X!Y~t>NnU`gcC>x#t}F z=XgAZV0~8ngZ#}S^cQ0$D>MeD-vD@kbfjYgnYe;6!<@mHe1-QhZ-mTnCG6vnA(&!C z1RT}{BVtA?Q6Gy&%#g0|hZvzFct%T??xRD1M-u_6%;<6n zW#dnnB#S-ys%kzk^xRRj`Yk*H3WJ4kJgIXb?J|x%2FqyfM9BR}9|01fvII z5ZRzIn3thrAyaGK^`iEuucS%ipkQ)cb2Q2dla)QeB+izlQ&w3|v~Dy=&9OaRGYrb+ zpR&Hti%c1*+tnQy2i*(V+76*%reOu}E?h2`uUA)If1~=*X8wb6{!*6rL`uGF6Wj43 z4qIW?|Fm^wUjs%QA`T)N59|woTMa)N0+Z?x^J}*NPkJmF7*0ni^=eH$T+W zQogXFmWZ*Ue!32m`r4`rqph;hw$O`6Q@%_h2=2*$}l%>A1)QOxVG6#2l)!js{m&o-KxlZh4c7Ff!hc9b0fJy^ul+k{kM;!i*9rgd>*cM3vObqmssm3);h6)lz1$qj-^yjO82Go5OL9K zcpyLbeev63Pfqsbq$?*+l==OuKNWxbxWD>|s}y=lp|2ENxiA!j@X`>$b_yw@jqI!^ z=?$%U%Ua%YoR;4b??np5t=^=XNp4$ods!zni)xNVZOT4F@A?1ef%Sg~e%rj6pmx+o z!L)Q@*rQR9&Na)Q1TWln>Y!x<=oj@7qDhA5VS5^R7o6J$d5>m*Wj_V`ci4tJ#(02U za)UHL%WjYc=v6mJ1GMM{X(%9^bkV|j8lYF)APrE;4HEcqv3oCc-ufZaQG0l|gC)Kgw}T diff --git a/api/views/__pycache__/views.cpython-311.pyc b/api/views/__pycache__/views.cpython-311.pyc deleted file mode 100644 index fc09eed28ebf529d9e3d2c1494cfb060d77b9ccb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 967 zcmZuvTTj$L6rSl`Sm~mO;N{6iFjAA<$}X&_Atn+H!3!GEmwnlk&UClZcFN4G7ZMX5 z{15yC4B^F}QW73W6MXT>w@o&_@Z_0tkqw@7zBzN|bj~;5neQVb!wBqf;U{%8gnp^T zslht4egmd0L=eFN3UL!-cp;I#Z) zu;?unF^dE>aeAdqWvk7dxYLqsjYbeEaY}qnUFqVi?lI(GQlmc)u!ZEgy={o>!Z^0C zSgO1eBX}D!ch9nci?(488z;6%rO_3X8-z;74}{@y78;@NaweE3jf|P$#J;Fz|7=|C zNEwSqmL+IVtISqcsj2Y-6yrqzQ%i?9UGGvMQ~lhngwoJ3j^0=u7E(+4F6+8$)OyNU zyvjaX@0MP@UbdDZkMYofU8la_SS!z7)~ppMW4&Lbk*v&Gz{C3J(@)|UtMQlga=_Yt z)H;=n>rhBB5eC2}`cp#J?(B_C?vG7wzJNt}JQ=^Yr%&(e(@B214>@Q+Wp$HG<@?|a zs!TA^NY2M?>|fM0znorogkY}kNJ^f>aR8T)J~TNUasI8A$i`HyZo9Pcz^>4G0~B<< zM#Y}7y^8&iHthNw_2#@et~i*OmtYdAcLrDQGo3i=OzX57)ZnAAr-rxL<`Zz1;w(A-vPRt41O0Qy;M1& From 286e628c728deaeee84dfa57558b547257736459 Mon Sep 17 00:00:00 2001 From: Alexandre Paice Date: Mon, 4 Mar 2024 12:02:34 +0100 Subject: [PATCH 8/8] push to develop --- api/models/lesgever.py | 2 +- api/views/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/models/lesgever.py b/api/models/lesgever.py index 1a2f11bd..85c70ac4 100644 --- a/api/models/lesgever.py +++ b/api/models/lesgever.py @@ -4,7 +4,7 @@ class Lesgever(models.Model): lesgever_id = models.AutoField(primary_key=True) name = models.CharField(max_length=100) - email = models.EmailField() + email = models.EmailField(default='email@email.com') subjects = models.ManyToManyField('Vak', related_name='lesgevers_enrolled', blank=True) is_admin = models.BooleanField(default=False) diff --git a/api/views/views.py b/api/views/views.py index c8d8d6e5..587ae2f9 100644 --- a/api/views/views.py +++ b/api/views/views.py @@ -1,4 +1,4 @@ -from django.http import JsonResponse +from django.http import JsonResponse, HttpResponse from api.utils import get_graph_token from django.shortcuts import redirect @@ -9,7 +9,7 @@ def login_redirect(request): """ graph_token = get_graph_token() - #HttpResponse(f"Logged in as {request.user.first_name} {request.user.last_name}, with email: {request.user.username} \nWith token: {graph_token['access_token']}") + return HttpResponse(f"Logged in as {request.user.first_name} {request.user.last_name}, with email: {request.user.username} \nWith token: {graph_token['access_token']}") return redirect("https://sel2-4.be")