Add routes and custom serialiser

Add requirements
This commit is contained in:
2019-04-18 21:43:22 +02:00
parent 31d5f7ade4
commit 1b1a19ae9d
6 changed files with 78 additions and 26 deletions

View File

@ -33,6 +33,7 @@ class Params(models.Model):
autonomy = models.IntegerField()
default_relay = models.IntegerField()
stand_minimum_time = models.IntegerField()
comment = models.CharField(max_length=250)
class Relay(models.Model):
@ -40,16 +41,16 @@ class Relay(models.Model):
driver = models.ForeignKey(Driver, on_delete=models.CASCADE)
# Fk kart
kart = models.ForeignKey(Kart, on_delete=models.CASCADE)
#Starting timestamp for the relay
# Starting timestamp for the relay
relay_start = models.DateTimeField()
#ending timestamp for the relay
# ending timestamp for the relay
relay_end = models.DateTimeField(default=None, blank=True, null=True)
#Does the previous pilot refuel
# Does the previous pilot refuel
has_refuel = models.BooleanField(default=False)
#Average chrono for the pulot on this relay
# Average chrono for the pulot on this relay
driver_chrono = models.IntegerField(default=None, blank=True, null=True)
#ending timestamp for the relay
# ending timestamp for the relay
relay_autonomy = models.IntegerField(default=None, blank=True, null=True)
#comment the relay
# comment the relay
comment = models.CharField(max_length=256, default=None, blank=True, null=True)