feat: Gestion multi-profil multi-école

This commit is contained in:
N3WT DE COMPET
2025-03-09 16:22:28 +01:00
parent 95c154a4a2
commit 16178296ec
51 changed files with 1621 additions and 802 deletions

View File

@ -4,6 +4,8 @@ from django.conf import settings
from django.utils.translation import gettext_lazy as _
from School.models import SchoolClass, Fee, Discount
from Auth.models import ProfileRole
from Establishment.models import Establishment
from datetime import datetime
@ -25,10 +27,9 @@ class Guardian(models.Model):
first_name = models.CharField(max_length=200, default="")
birth_date = models.CharField(max_length=200, default="", blank=True)
address = models.CharField(max_length=200, default="", blank=True)
email = models.CharField(max_length=200, default="", blank=True)
phone = models.CharField(max_length=200, default="", blank=True)
profession = models.CharField(max_length=200, default="", blank=True)
associated_profile = models.ForeignKey('Auth.Profile', on_delete=models.CASCADE)
profile_role = models.OneToOneField(ProfileRole, on_delete=models.CASCADE, related_name='guardian_profile', null=True, blank=True)
def __str__(self):
return self.last_name + "_" + self.first_name
@ -163,6 +164,7 @@ class Student(models.Model):
class RegistrationFileGroup(models.Model):
name = models.CharField(max_length=255, default="")
description = models.TextField(blank=True, null=True)
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE, related_name='file_group', null=True, blank=True)
def __str__(self):
return self.name
@ -214,7 +216,7 @@ class RegistrationForm(models.Model):
null=True,
blank=True)
establishment = models.ForeignKey('School.Establishment', on_delete=models.CASCADE, related_name='register_forms')
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE, related_name='register_forms')
def __str__(self):
return "RF_" + self.student.last_name + "_" + self.student.first_name