mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-03 17:22:51 +02:00
Add Payment model
This commit is contained in:
@ -288,3 +288,52 @@ class AdminRegistration(VolunteerRegistration):
|
||||
class Meta:
|
||||
verbose_name = _("admin registration")
|
||||
verbose_name_plural = _("admin registrations")
|
||||
|
||||
|
||||
def get_scholarship_filename(instance, filename):
|
||||
return f"authorization/scholarship/scholarship_{instance.registration.pk}"
|
||||
|
||||
|
||||
class Payment(models.Model):
|
||||
registration = models.OneToOneField(
|
||||
ParticipantRegistration,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="registration",
|
||||
verbose_name=_("registration"),
|
||||
)
|
||||
|
||||
type = models.CharField(
|
||||
verbose_name=_("type"),
|
||||
max_length=16,
|
||||
choices=[
|
||||
('', _("No payment")),
|
||||
('helloasso', "Hello Asso"),
|
||||
('scholarship', _("Scholarship")),
|
||||
('bank_transfer', _("Bank transfer")),
|
||||
('free', _("The tournament is free")),
|
||||
],
|
||||
blank=True,
|
||||
default="",
|
||||
)
|
||||
|
||||
scholarship_file = models.FileField(
|
||||
verbose_name=_("scholarship file"),
|
||||
help_text=_("only if you have a scholarship."),
|
||||
upload_to=get_scholarship_filename,
|
||||
unique=True,
|
||||
blank=True,
|
||||
default="",
|
||||
)
|
||||
|
||||
additional_information = models.TextField(
|
||||
verbose_name=_("additional information"),
|
||||
help_text=_("To help us to find your payment."),
|
||||
blank=True,
|
||||
default="",
|
||||
)
|
||||
|
||||
valid = models.BooleanField(
|
||||
verbose_name=_("valid"),
|
||||
null=True,
|
||||
default=False,
|
||||
)
|
||||
|
Reference in New Issue
Block a user