feat: ajout des documents d'inscription [#20]

This commit is contained in:
Luc SORIGNET
2025-01-25 12:19:30 +01:00
parent 799e1c6717
commit b8ef34a04b
12 changed files with 449 additions and 321 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)
def __str__(self):