From 09e6693c363067ed9a4c00b61331ae8864a5d9cc Mon Sep 17 00:00:00 2001 From: ticoucke Date: Tue, 12 Mar 2024 15:36:00 +0100 Subject: [PATCH] small fixes to models, serializers and views --- api/models/project.py | 4 ++-- api/views/indiening.py | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/api/models/project.py b/api/models/project.py index abddc78a..58016522 100644 --- a/api/models/project.py +++ b/api/models/project.py @@ -9,8 +9,8 @@ def upload_to(instance, filename): class Project(models.Model): project_id = models.AutoField(primary_key=True) titel = models.CharField(max_length=100) - description = models.TextField() - opgave_bestanden = models.FileField(upload_to=upload_to) + beschrijving = models.TextField() + opgave_bestand = models.FileField(upload_to=upload_to) vak = models.ForeignKey(Vak, on_delete=models.CASCADE) deadline = models.DateTimeField(null=True) max_score = models.IntegerField(default=20) diff --git a/api/views/indiening.py b/api/views/indiening.py index c97e5c66..670c675d 100644 --- a/api/views/indiening.py +++ b/api/views/indiening.py @@ -12,13 +12,6 @@ def indiening_list(request, format=None): if request.method == 'GET': indieningen = Indiening.objects.all() - if "project" in request.GET: - try: - project = eval(request.GET.get('project')) - indieningen = indieningen.filter(project=project) - except NameError: - return Response(status=status.HTTP_400_BAD_REQUEST) - if "groep" in request.GET: try: groep = eval(request.GET.get('groep'))