mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 19:43:16 +02:00
Sección Pruebas añadida
This commit is contained in:
parent
1d1c7a61e9
commit
6100199e9c
8 changed files with 444 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from django.db import models
|
||||
from django.conf import settings
|
||||
from temporadas.models import Temporada
|
||||
import os
|
||||
|
||||
class Prueba(models.Model):
|
||||
CATEGORIAS_TEST = (
|
||||
|
|
@ -52,6 +53,13 @@ class Telemetria(models.Model):
|
|||
def __str__(self):
|
||||
return f"Telemetría: {self.nombre} (De: {self.prueba.nombre})"
|
||||
|
||||
def delete(self, *args, **kwargs):
|
||||
# Borra el archivo físico del disco duro cuando borras la entrada en la base de datos
|
||||
if self.archivo_csv:
|
||||
if os.path.isfile(self.archivo_csv.path):
|
||||
os.remove(self.archivo_csv.path)
|
||||
super().delete(*args, **kwargs)
|
||||
|
||||
|
||||
class Variable(models.Model):
|
||||
nombre = models.CharField(max_length=50, verbose_name="Nombre ")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue