feat: Utilisation de l'établissement en variable de session / gestion de

la page des inscriptions en fonction de l'établissement / mise à jour du
mock_data à l'init
This commit is contained in:
N3WT DE COMPET
2025-03-06 20:08:16 +01:00
parent c03fa0ba42
commit f2ad1de5a4
20 changed files with 464 additions and 372 deletions

View File

@ -3,8 +3,7 @@ from django.utils.timezone import now
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from Auth.models import Profile
from School.models import SchoolClass, Fee, Discount, Establishment
from School.models import SchoolClass, Fee, Discount
from datetime import datetime
@ -29,7 +28,7 @@ class Guardian(models.Model):
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(Profile, on_delete=models.CASCADE)
associated_profile = models.ForeignKey('Auth.Profile', on_delete=models.CASCADE)
def __str__(self):
return self.last_name + "_" + self.first_name
@ -80,7 +79,7 @@ class Student(models.Model):
payment_method = models.IntegerField(choices=PaymentMethod, default=PaymentMethod.NONE, blank=True)
# Many-to-Many Relationship
profiles = models.ManyToManyField(Profile, blank=True)
profiles = models.ManyToManyField('Auth.Profile', blank=True)
# Many-to-Many Relationship
guardians = models.ManyToManyField(Guardian, blank=True)
@ -215,7 +214,7 @@ class RegistrationForm(models.Model):
null=True,
blank=True)
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE, related_name='register_forms')
establishment = models.ForeignKey('School.Establishment', on_delete=models.CASCADE, related_name='register_forms')
def __str__(self):
return "RF_" + self.student.last_name + "_" + self.student.first_name