mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 11:33:17 +02:00
Admins.py configurados correctamente dados los cambios realizado en la base de datos
This commit is contained in:
parent
99426f7335
commit
e64a08326c
26 changed files with 416 additions and 34 deletions
Binary file not shown.
Binary file not shown.
|
|
@ -3,11 +3,17 @@ from .models import Temporada
|
|||
|
||||
@admin.register(Temporada)
|
||||
class TemporadaAdmin(admin.ModelAdmin):
|
||||
# Esto define qué columnas se ven en la lista
|
||||
# Columnas principales.
|
||||
list_display = ('nombre', 'fecha_inicio', 'fecha_fin', 'presupuesto', 'actual')
|
||||
|
||||
# Esto añade un filtro a la derecha para ver rápido cuál es la actual
|
||||
# Permite marcar o desmarcar el check de "actual" directamente desde la tabla, sin entrar al detalle
|
||||
list_editable = ('actual',)
|
||||
|
||||
# Filtro para filtrar por temporadas históricas o actual
|
||||
list_filter = ('actual',)
|
||||
|
||||
# Esto añade una barra de búsqueda por nombre
|
||||
search_fields = ('nombre',)
|
||||
# Buscador de temporadas por nombre
|
||||
search_fields = ('nombre',)
|
||||
|
||||
# Filtro para ver los miembros de una temporada
|
||||
filter_horizontal = ('miembros',)
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# Generated by Django 6.0.2 on 2026-03-06 19:29
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('temporadas', '0001_initial'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='temporada',
|
||||
name='miembros',
|
||||
field=models.ManyToManyField(blank=True, related_name='temporadas_participadas', to=settings.AUTH_USER_MODEL, verbose_name='Miembros del equipo'),
|
||||
),
|
||||
]
|
||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue