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/court.py

17 lines
583 B

from django.db import models
import uuid
from . import BaseModel, Club
class Court(BaseModel):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=True)
index = models.IntegerField(default=0)
club = models.ForeignKey(Club, on_delete=models.CASCADE)
name = models.CharField(max_length=50, null=True, blank=True)
exit_allowed = models.BooleanField(default=False)
indoor = models.BooleanField(default=False)
def __str__(self):
if self.name:
return self.name
else:
return f"Terrain {self.index + 1}"