Commit be8d2e7f authored by EJ Mejilla's avatar EJ Mejilla

Updated the README file for Lab 2.

parent 09fce4b3
Eduard James G. Mejilla, 213936, 2 BS CS-DGDD, CSCI 40 F Eduard James G. Mejilla, 213936, 2 BS CS-DGDD, CSCI 40 F
LAB 01: Song Library LAB 02: Song Library v2
February 13, 2023 February 13, 2023
I hereby certify that I have truthfully completes all the I hereby certify that I have truthfully completed all the
tasks f this lab on my own. tasks of this lab on my own.
Eduard James G. Mejilla, February 13, 2023 Eduard James G. Mejilla, February 20, 2023
from django.contrib import admin from django.contrib import admin
# Register your models here. from .models import Artist, Song, Album
class ArtistAdmin(admin.ModelAdmin):
model = Artist
list_display = ('artist_name', 'monthly_listeners')
class AlbumAdmin(admin.ModelAdmin):
model = Album
list_display = ('album_name', 'artist')
class SongAdmin(admin.ModelAdmin):
model = Song
list_display = ('song_title', 'artist', 'album')
admin.site.register(Artist, ArtistAdmin)
admin.site.register(Album, AlbumAdmin)
admin.site.register(Song, SongAdmin)
# Generated by Django 3.2 on 2023-02-13 12:52
from django.db import migrations, models
import django.db.models.deletion
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=100, unique=True)),
('description', models.CharField(max_length=500)),
('release_date', models.DateField()),
],
),
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=100, unique=True)),
('monthly_listeners', models.IntegerField()),
],
),
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=100, unique=True)),
('song_length', models.IntegerField()),
('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.album')),
('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.artist')),
],
),
migrations.AddField(
model_name='album',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.artist'),
),
]
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