added documentation for models

This commit is contained in:
faraphel-gima 2023-11-27 16:14:07 +01:00
parent 82a862a142
commit 541cadaa3e

View file

@ -7,6 +7,13 @@ from django.db import models
# Create your models here.
class Department(models.Model):
"""
A scholar department.
For example, a same server can handle both a science department and a sport department.
ALl have their own managers, teachers and student.
"""
id: uuid.UUID = models.UUIDField(default=uuid.uuid4, primary_key=True, editable=False, max_length=36)
name: str = models.CharField(max_length=32)
@ -16,6 +23,15 @@ class Department(models.Model):
class StudentGroup(models.Model):
"""
A student group.
This make selecting multiple students with a specificity easier.
For example, if students are registered to an English course,
putting them in a same group make them easier to select.
"""
id: uuid.UUID = models.UUIDField(default=uuid.uuid4, primary_key=True, editable=False, max_length=36)
name: str = models.CharField(max_length=32)
@ -23,6 +39,15 @@ class StudentGroup(models.Model):
class TeachingUnit(models.Model):
"""
A teaching unit.
This represents a unit that can be taught to groups of student.
For example, Maths, English, French, Computer Science are all teaching units.
The registered groups are groups of student allowed to participate in these units.
"""
id: uuid.UUID = models.UUIDField(default=uuid.uuid4, primary_key=True, editable=False, max_length=36)
name: str = models.CharField(max_length=32)
@ -30,6 +55,12 @@ class TeachingUnit(models.Model):
class StudentCard(models.Model):
"""
A student card.
This represents a student NFC card.
"""
id: uuid.UUID = models.UUIDField(default=uuid.uuid4, primary_key=True, editable=False, max_length=36)
uid: bytes = models.BinaryField(max_length=7)
@ -37,6 +68,14 @@ class StudentCard(models.Model):
class TeachingSession(models.Model):
"""
A session of a teaching unit.
For example, a session of English would be a single course of this unit.
It references a teacher responsible for scanning the student cards, student attendances and student absences.
"""
id: uuid.UUID = models.UUIDField(default=uuid.uuid4, primary_key=True, editable=False, max_length=36)
start: datetime = models.DateTimeField()
duration: timedelta = models.DurationField()
@ -49,6 +88,12 @@ class TeachingSession(models.Model):
class Attendance(models.Model):
"""
A student attendance to a session.
When a student confirm his presence to a session, this is represented by this model.
"""
id: uuid.UUID = models.UUIDField(default=uuid.uuid4, primary_key=True, editable=False, max_length=36)
date: datetime = models.DateTimeField()
@ -56,6 +101,12 @@ class Attendance(models.Model):
class Absence(models.Model):
"""
A student justified absence to a session.
When a student signal his absence to a session, this is represented by this model.
"""
id: uuid.UUID = models.UUIDField(default=uuid.uuid4, primary_key=True, editable=False, max_length=36)
message: str = models.TextField()
@ -63,6 +114,12 @@ class Absence(models.Model):
class AbsenceAttachment(models.Model):
"""
An attachment to a student justified absence.
The student can add additional files to justify his absence.
"""
id: uuid.UUID = models.UUIDField(default=uuid.uuid4, primary_key=True, editable=False, max_length=36)
content = models.FileField()