Skip to content

Commit

Permalink
added a model for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderVanOyen committed Feb 28, 2024
1 parent 06f4fb9 commit 076b1fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Empty file.
17 changes: 17 additions & 0 deletions backend/pigeonhole/apps/groups/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from django.db import models
from rest_framework import serializers

from backend.pigeonhole.apps.projects.models import Project


class Group(models.Model):
group_id = models.BigAutoField(primary_key=True)
group_nr = models.IntegerField()
final_score = models.IntegerField()
project_id = models.ForeignKey(Project, on_delete=models.CASCADE)


class GroupSerializer(serializers.ModelSerializer):
class Meta:
model = Group
fields = ["group_id", "group_nr", "final_score", "project_id"]

0 comments on commit 076b1fb

Please sign in to comment.