Spaces:
Sleeping
Sleeping
File size: 1,183 Bytes
d2ce909 8ff54ff d2ce909 8ff54ff d2ce909 8ff54ff d2ce909 8ff54ff d2ce909 8ff54ff | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | from django.db import models
class Whitelist(models.Model):
name = models.CharField(max_length=255)
email = models.EmailField(unique=True)
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return f"{self.name} ({self.email})"
class Participant(models.Model):
# Identity
name = models.CharField(max_length=255)
email = models.EmailField(unique=True)
student_id = models.CharField(max_length=50)
# Quiz Data
role = models.CharField(max_length=50, default="developer")
quiz_data = models.JSONField(default=dict)
# System Flags
is_matched = models.BooleanField(default=False)
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.name
class Match(models.Model):
participant_1 = models.ForeignKey(Participant, related_name='match_1', on_delete=models.CASCADE)
participant_2 = models.ForeignKey(Participant, related_name='match_2', on_delete=models.CASCADE)
compatibility_score = models.FloatField()
created_at = models.DateTimeField(auto_now_add=True)
class Meta:
unique_together = ('participant_1', 'participant_2') |