Merge branch 'refactoring' of ssh://git.v0id.ovh:5022/n3wt-innov/n3wt-school into refactoring

This commit is contained in:
N3WT DE COMPET
2025-01-25 18:01:31 +01:00
12 changed files with 444 additions and 316 deletions

View File

@ -182,6 +182,10 @@ class Student(models.Model):
return self.birth_date.strftime('%d-%m-%Y')
return None
def registration_file_path(instance, filename):
# Génère le chemin : registration_files/dossier_rf_{student_id}/filename
return f'registration_files/dossier_rf_{instance.student_id}/{filename}'
class RegistrationForm(models.Model):
"""
Gère le dossier dinscription lié à un élève donné.
@ -201,7 +205,11 @@ class RegistrationForm(models.Model):
last_update = models.DateTimeField(auto_now=True)
notes = models.CharField(max_length=200, blank=True)
registration_link_code = models.CharField(max_length=200, default="", blank=True)
registration_file = models.FileField(upload_to=settings.DOCUMENT_DIR, default="", blank=True)
registration_file = models.FileField(
upload_to=registration_file_path,
null=True,
blank=True
)
associated_rf = models.CharField(max_length=200, default="", blank=True)
# Many-to-Many Relationship