2023-06-26 22:06:05 +08:00
|
|
|
from django.db import models
|
|
|
|
from accounts.models import CustomUser
|
2023-06-27 21:12:03 +08:00
|
|
|
from study_groups.models import StudyGroup
|
2023-06-26 22:06:05 +08:00
|
|
|
|
|
|
|
# Create your models here.
|
|
|
|
|
|
|
|
|
|
|
|
class StudentStatus(models.Model):
|
|
|
|
user = models.OneToOneField(
|
|
|
|
CustomUser, on_delete=models.CASCADE, primary_key=True)
|
2023-06-26 23:50:55 +08:00
|
|
|
x = models.FloatField(null=True)
|
|
|
|
y = models.FloatField(null=True)
|
2023-06-27 21:12:03 +08:00
|
|
|
subject = models.ForeignKey(
|
|
|
|
'subjects.Subject', on_delete=models.CASCADE, null=True)
|
2023-06-26 23:50:55 +08:00
|
|
|
active = models.BooleanField(default=False)
|
2023-06-26 22:06:05 +08:00
|
|
|
timestamp = models.DateField(auto_now_add=True)
|
2023-06-27 21:12:03 +08:00
|
|
|
study_group = models.ForeignKey(
|
|
|
|
StudyGroup, on_delete=models.SET_NULL, null=True)
|