Migrated Models

parent 390def2b
from django.contrib import admin
from .models import Artist, Album, Song
# Register your models here.
class ArtistAdmin(admin.ModelAdmin):
model = Artist
class AlbumAdmin(admin.ModelAdmin):
model = Album
class SongAdmin(admin.ModelAdmin):
model = Song
admin.site.register(Artist, ArtistAdmin)
admin.site.register(Album, AlbumAdmin)
admin.site.register(Song, SongAdmin)
# Generated by Django 3.2 on 2023-02-20 14:34
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Album',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('album_name', models.CharField(max_length=50)),
('artist', models.CharField(max_length=50)),
('description', models.TextField()),
('release_date', models.DateTimeField()),
('label', models.TextField()),
('song_count', models.IntegerField()),
],
),
migrations.CreateModel(
name='Artist',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('artist_name', models.CharField(max_length=50)),
('birth_name', models.TextField()),
('monthly_listeners', models.IntegerField()),
('bio', models.CharField(max_length=700)),
],
),
migrations.CreateModel(
name='Song',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('song_title', models.CharField(max_length=50)),
('song_length', models.IntegerField()),
('lyrics', models.TextField()),
('music_video', models.BooleanField()),
('artist', models.CharField(max_length=50)),
('album', models.CharField(max_length=50)),
],
),
]
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