You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
padelclub_backend/tournaments/models/player_registration.py

19 lines
727 B

from django.db import models
from . import TeamRegistration
import uuid
class PlayerRegistration(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
team_registration = models.ForeignKey(TeamRegistration, on_delete=models.CASCADE)
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
licence_id = models.CharField(max_length=20, null=True, blank=True)
rank = models.IntegerField(null=True, blank=True)
has_paid = models.BooleanField(default=False)
unranked = models.BooleanField(default=False)
def __str__(self):
return self.name()
def name(self):
return f"{self.first_name} {self.last_name}"