Commit 9edcf77c authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

Models are no longer asking for defaults on the terminal

parent a7136615
# Generated by Django 3.2 on 2023-02-16 16:05 # Generated by Django 3.2 on 2023-02-23 13:03
import datetime
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
...@@ -7,7 +8,7 @@ import django.db.models.deletion ...@@ -7,7 +8,7 @@ import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('about', '0002_subject'), ('about', '0001_initial'),
] ]
operations = [ operations = [
...@@ -15,38 +16,41 @@ class Migration(migrations.Migration): ...@@ -15,38 +16,41 @@ class Migration(migrations.Migration):
name='Album', name='Album',
fields=[ fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('album_name', models.CharField(max_length=50, unique=True)), ('album_name', models.CharField(blank=True, max_length=50, unique=True)),
('description', models.CharField(max_length=500, unique=True)), ('description', models.CharField(blank=True, max_length=500, unique=True)),
('release_date', models.DateField()), ('release_date', models.DateField(default=datetime.datetime(2023, 2, 23, 21, 3, 39, 527553))),
('label', models.CharField(blank=True, max_length=50, unique=True)),
('song_count', models.IntegerField(blank=True)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Artist', name='Artist',
fields=[ fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('artist_name', models.CharField(max_length=50, unique=True)), ('artist_name', models.CharField(blank=True, max_length=50, unique=True)),
('monthly_listeners', models.IntegerField()), ('monthly_listeners', models.IntegerField(default=1)),
('birth_name', models.CharField(blank=True, max_length=50, unique=True)),
('bio', models.TextField(blank=True)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
name='Song', name='Song',
fields=[ fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('song_title', models.CharField(max_length=50)), ('song_title', models.CharField(blank=True, max_length=50)),
('song_length', models.TimeField()), ('song_length', models.TimeField(default=datetime.datetime(2023, 2, 23, 21, 3, 39, 527552))),
('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='about.album')), ('music_video', models.BooleanField(default=False)),
('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='single', to='about.artist')), ('lyrics', models.TextField(blank=True)),
('album', models.ForeignKey(default='justToMakeItWorkToo', on_delete=django.db.models.deletion.CASCADE, to='about.album')),
('artist', models.ForeignKey(default='justToMakeItWork', on_delete=django.db.models.deletion.CASCADE, related_name='single', to='about.artist')),
], ],
), ),
migrations.DeleteModel( migrations.DeleteModel(
name='IndexCard', name='IndexCard',
), ),
migrations.DeleteModel(
name='Subject',
),
migrations.AddField( migrations.AddField(
model_name='album', model_name='album',
name='artist', name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='about.artist'), field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='about.artist'),
), ),
] ]
# Generated by Django 3.2 on 2023-02-16 15:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('about', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Subject',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('teacher_name', models.CharField(max_length=50)),
('units', models.IntegerField()),
],
),
]
# Generated by Django 3.2 on 2023-02-21 14:19
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('about', '0003_auto_20230217_0005'),
]
operations = [
migrations.RemoveField(
model_name='album',
name='album_name',
),
migrations.RemoveField(
model_name='album',
name='artist',
),
migrations.RemoveField(
model_name='album',
name='description',
),
migrations.RemoveField(
model_name='album',
name='release_date',
),
migrations.RemoveField(
model_name='artist',
name='artist_name',
),
migrations.RemoveField(
model_name='artist',
name='monthly_listeners',
),
migrations.RemoveField(
model_name='song',
name='album',
),
migrations.RemoveField(
model_name='song',
name='artist',
),
migrations.RemoveField(
model_name='song',
name='song_length',
),
migrations.RemoveField(
model_name='song',
name='song_title',
),
migrations.AddField(
model_name='album',
name='label',
field=models.CharField(default=django.utils.timezone.now, max_length=50, unique=True),
preserve_default=False,
),
migrations.AddField(
model_name='album',
name='song_count',
field=models.IntegerField(default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='artist',
name='bio',
field=models.TextField(default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='artist',
name='birth_name',
field=models.CharField(default=django.utils.timezone.now, max_length=50, unique=True),
preserve_default=False,
),
migrations.AddField(
model_name='song',
name='lyrics',
field=models.TextField(default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='song',
name='music_video',
field=models.BooleanField(default=django.utils.timezone.now),
preserve_default=False,
),
]
# about/models.py # about/models.py
from django.db import models from django.db import models
import datetime
class Artist(models.Model): class Artist(models.Model):
artist_name = models.CharField(max_length=50, unique=True) artist_name = models.CharField(max_length=50, unique=True,blank=True)
monthly_listeners = models.IntegerField() monthly_listeners = models.IntegerField(default=1)
birth_name = models.CharField(max_length=50, unique=True) birth_name = models.CharField(max_length=50, unique=True, blank=True,)
bio = models.TextField(null=False) bio = models.TextField(blank=True,)
pass pass
class Album(models.Model): class Album(models.Model):
album_name = models.CharField(max_length=50, unique=True) album_name = models.CharField(max_length=50, unique=True, blank=True,)
artist = models.ForeignKey( artist = models.ForeignKey(
Artist, Artist,
on_delete=models.CASCADE, on_delete=models.CASCADE,
default=1
) )
description = models.CharField(max_length=500, unique=True) description = models.CharField(max_length=500, unique=True, blank=True,)
release_date = models.DateField() release_date = models.DateField(default=datetime.datetime.today())
label = models.CharField(max_length=50, unique=True) label = models.CharField(max_length=50, unique=True, blank=True,)
song_count = models.IntegerField() song_count = models.IntegerField(blank=True,)
pass pass
class Song(models.Model): class Song(models.Model):
song_title = models.CharField(max_length=50) song_title = models.CharField(max_length=50, blank=True,)
artist = models.ForeignKey( artist = models.ForeignKey(
Artist, Artist,
on_delete=models.CASCADE, on_delete=models.CASCADE,
related_name='single' related_name='single',
default="justToMakeItWork",
) )
album = models.ForeignKey( album = models.ForeignKey(
Album, Album,
on_delete=models.CASCADE, on_delete=models.CASCADE,
default="justToMakeItWorkToo",
) )
song_length = models.TimeField() song_length = models.TimeField(default=datetime.datetime.now())
music_video = models.BooleanField() music_video = models.BooleanField(default=False)
lyrics = models.TextField() lyrics = models.TextField(blank=True,)
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment