initial commit. displays simple hierarchy and lists of models. includes fixtures for initial data.
This commit is contained in:
37
players/migrations/0001_initial.py
Normal file
37
players/migrations/0001_initial.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# Generated by Django 3.2.6 on 2021-11-07 17:43
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Player',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('first_name', models.CharField(max_length=200)),
|
||||
('last_name', models.CharField(max_length=200)),
|
||||
('jersey_number', models.IntegerField()),
|
||||
],
|
||||
options={
|
||||
'unique_together': {('first_name', 'last_name')},
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Stat',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('batting_avg', models.DecimalField(decimal_places=3, default=0, max_digits=4)),
|
||||
('onbase_pct', models.DecimalField(decimal_places=3, default=0, max_digits=4)),
|
||||
('slugging_pct', models.DecimalField(decimal_places=3, default=0, max_digits=4)),
|
||||
('player', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='players.player')),
|
||||
],
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user