Add v2 relational domain foundations with import run/file models
This commit is contained in:
@ -5,6 +5,6 @@ from .models import Team
|
||||
|
||||
@admin.register(Team)
|
||||
class TeamAdmin(admin.ModelAdmin):
|
||||
list_display = ("name", "short_name", "country", "is_national_team")
|
||||
list_display = ("name", "source_uid", "short_name", "country", "is_national_team")
|
||||
list_filter = ("is_national_team", "country")
|
||||
search_fields = ("name", "short_name", "slug")
|
||||
search_fields = ("name", "short_name", "slug", "source_uid")
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
# Generated by Django 5.2.12 on 2026-03-13 12:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('players', '0006_player_source_uid_and_more'),
|
||||
('teams', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='team',
|
||||
name='source_uid',
|
||||
field=models.CharField(blank=True, max_length=120, null=True, unique=True),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='team',
|
||||
index=models.Index(fields=['source_uid'], name='teams_team_source__940258_idx'),
|
||||
),
|
||||
]
|
||||
@ -5,6 +5,7 @@ class Team(models.Model):
|
||||
name = models.CharField(max_length=200)
|
||||
short_name = models.CharField(max_length=80, blank=True)
|
||||
slug = models.SlugField(max_length=220, unique=True)
|
||||
source_uid = models.CharField(max_length=120, blank=True, null=True, unique=True)
|
||||
country = models.ForeignKey(
|
||||
"players.Nationality",
|
||||
on_delete=models.SET_NULL,
|
||||
@ -25,6 +26,7 @@ class Team(models.Model):
|
||||
indexes = [
|
||||
models.Index(fields=["name"]),
|
||||
models.Index(fields=["slug"]),
|
||||
models.Index(fields=["source_uid"]),
|
||||
models.Index(fields=["country"]),
|
||||
models.Index(fields=["is_national_team"]),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user