mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 11:33:17 +02:00
App gestion y pruebas añadidas a la base de datos
This commit is contained in:
parent
0e0c8d7d1b
commit
ec44ae2e46
26 changed files with 209 additions and 3 deletions
0
Plataform_Web/pruebas/__init__.py
Normal file
0
Plataform_Web/pruebas/__init__.py
Normal file
BIN
Plataform_Web/pruebas/__pycache__/__init__.cpython-314.pyc
Normal file
BIN
Plataform_Web/pruebas/__pycache__/__init__.cpython-314.pyc
Normal file
Binary file not shown.
BIN
Plataform_Web/pruebas/__pycache__/admin.cpython-314.pyc
Normal file
BIN
Plataform_Web/pruebas/__pycache__/admin.cpython-314.pyc
Normal file
Binary file not shown.
BIN
Plataform_Web/pruebas/__pycache__/apps.cpython-314.pyc
Normal file
BIN
Plataform_Web/pruebas/__pycache__/apps.cpython-314.pyc
Normal file
Binary file not shown.
BIN
Plataform_Web/pruebas/__pycache__/models.cpython-314.pyc
Normal file
BIN
Plataform_Web/pruebas/__pycache__/models.cpython-314.pyc
Normal file
Binary file not shown.
8
Plataform_Web/pruebas/admin.py
Normal file
8
Plataform_Web/pruebas/admin.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
from django.contrib import admin
|
||||
from .models import TestGeneral
|
||||
|
||||
@admin.register(TestGeneral)
|
||||
class TestGeneralAdmin(admin.ModelAdmin):
|
||||
list_display = ('nombre', 'fecha_inicio', 'fecha_fin', 'categoria', 'temporada')
|
||||
list_filter = ('categoria', 'temporada')
|
||||
search_fields = ('nombre', 'descripcion', 'resultados')
|
||||
5
Plataform_Web/pruebas/apps.py
Normal file
5
Plataform_Web/pruebas/apps.py
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class PruebasConfig(AppConfig):
|
||||
name = 'pruebas'
|
||||
34
Plataform_Web/pruebas/migrations/0001_initial.py
Normal file
34
Plataform_Web/pruebas/migrations/0001_initial.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Generated by Django 6.0.2 on 2026-02-19 10:14
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('temporadas', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='TestGeneral',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('nombre', models.CharField(max_length=150, verbose_name='Nombre del Test')),
|
||||
('descripcion', models.TextField(verbose_name='Objetivo / Descripción del test')),
|
||||
('fecha_inicio', models.DateField()),
|
||||
('fecha_fin', models.DateField()),
|
||||
('categoria', models.CharField(choices=[('aerodinamica', 'Aerodinámica'), ('chasis', 'Chasis'), ('business', 'Business & Operations'), ('epowertrain', 'E-Powertrain'), ('electronica', 'Electrónica'), ('sdf', 'SDF'), ('motor_transmision', 'Motor & Transmisión'), ('general', 'General')], default='general', max_length=30)),
|
||||
('resultados', models.TextField(blank=True, null=True, verbose_name='Conclusiones y Resultados')),
|
||||
('temporada', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='temporadas.temporada')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Test General',
|
||||
'verbose_name_plural': 'Tests Generales',
|
||||
'ordering': ['-fecha_inicio'],
|
||||
},
|
||||
),
|
||||
]
|
||||
0
Plataform_Web/pruebas/migrations/__init__.py
Normal file
0
Plataform_Web/pruebas/migrations/__init__.py
Normal file
Binary file not shown.
Binary file not shown.
35
Plataform_Web/pruebas/models.py
Normal file
35
Plataform_Web/pruebas/models.py
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
from django.db import models
|
||||
from temporadas.models import Temporada
|
||||
|
||||
class TestGeneral(models.Model):
|
||||
CATEGORIAS_TEST = (
|
||||
('aerodinamica', 'Aerodinámica'),
|
||||
('chasis', 'Chasis'),
|
||||
('business', 'Business & Operations'),
|
||||
('epowertrain', 'E-Powertrain'),
|
||||
('electronica', 'Electrónica'),
|
||||
('sdf', 'SDF'),
|
||||
('motor_transmision', 'Motor & Transmisión'),
|
||||
('general', 'General'),
|
||||
)
|
||||
|
||||
nombre = models.CharField(max_length=150, verbose_name="Nombre del Test")
|
||||
descripcion = models.TextField(verbose_name="Objetivo / Descripción del test")
|
||||
|
||||
fecha_inicio = models.DateField()
|
||||
fecha_fin = models.DateField()
|
||||
|
||||
categoria = models.CharField(max_length=30, choices=CATEGORIAS_TEST, default='general')
|
||||
|
||||
resultados = models.TextField(blank=True, null=True, verbose_name="Conclusiones y Resultados")
|
||||
|
||||
# Relación
|
||||
temporada = models.ForeignKey(Temporada, on_delete=models.CASCADE)
|
||||
|
||||
class Meta:
|
||||
verbose_name = "Test General"
|
||||
verbose_name_plural = "Tests Generales"
|
||||
ordering = ['-fecha_inicio']
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.nombre} ({self.fecha_inicio})"
|
||||
3
Plataform_Web/pruebas/tests.py
Normal file
3
Plataform_Web/pruebas/tests.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
3
Plataform_Web/pruebas/views.py
Normal file
3
Plataform_Web/pruebas/views.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Loading…
Add table
Add a link
Reference in a new issue