Add v2 relational domain foundations with import run/file models
This commit is contained in:
@ -37,6 +37,7 @@ class PlayerCareerEntryInline(admin.TabularInline):
|
||||
class PlayerAdmin(admin.ModelAdmin):
|
||||
list_display = (
|
||||
"full_name",
|
||||
"source_uid",
|
||||
"birth_date",
|
||||
"nationality",
|
||||
"nominal_position",
|
||||
@ -53,7 +54,7 @@ class PlayerAdmin(admin.ModelAdmin):
|
||||
"origin_competition",
|
||||
"origin_team",
|
||||
)
|
||||
search_fields = ("full_name", "first_name", "last_name")
|
||||
search_fields = ("full_name", "first_name", "last_name", "source_uid")
|
||||
inlines = (PlayerAliasInline, PlayerCareerEntryInline)
|
||||
actions = ("recompute_origin_fields",)
|
||||
|
||||
|
||||
24
apps/players/migrations/0006_player_source_uid_and_more.py
Normal file
24
apps/players/migrations/0006_player_source_uid_and_more.py
Normal file
@ -0,0 +1,24 @@
|
||||
# Generated by Django 5.2.12 on 2026-03-13 12:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('competitions', '0003_competition_source_uid_season_source_uid_and_more'),
|
||||
('players', '0005_player_weight_index'),
|
||||
('teams', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='player',
|
||||
name='source_uid',
|
||||
field=models.CharField(blank=True, max_length=120, null=True, unique=True),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name='player',
|
||||
index=models.Index(fields=['source_uid'], name='players_pla_source__93bb47_idx'),
|
||||
),
|
||||
]
|
||||
@ -58,6 +58,7 @@ class Player(TimeStampedModel):
|
||||
first_name = models.CharField(max_length=120)
|
||||
last_name = models.CharField(max_length=120)
|
||||
full_name = models.CharField(max_length=260)
|
||||
source_uid = models.CharField(max_length=120, blank=True, null=True, unique=True)
|
||||
birth_date = models.DateField(blank=True, null=True)
|
||||
nationality = models.ForeignKey(
|
||||
"players.Nationality",
|
||||
@ -114,6 +115,7 @@ class Player(TimeStampedModel):
|
||||
]
|
||||
indexes = [
|
||||
models.Index(fields=["full_name"]),
|
||||
models.Index(fields=["source_uid"]),
|
||||
models.Index(fields=["last_name", "first_name"]),
|
||||
models.Index(fields=["birth_date"]),
|
||||
models.Index(fields=["nationality"]),
|
||||
|
||||
Reference in New Issue
Block a user