Commit 4b3a558c authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

cleanup of pyc files in master branch

parent fe4e04b6
# To create admins for the 2 models (Subject and IndexCard)
# app/admin.py
from django.contrib import admin from django.contrib import admin
from .models import Artist, Album, Song
# Register your models here.
class ArtistAdmin(admin.ModelAdmin):
list_display = ('artist_name', 'birth_name', 'monthly_listeners',)
search_fields = ('artist_name', 'birth_name',)
list_filter = ('artist_name', 'birth_name',)
pass
class AlbumAdmin(admin.ModelAdmin):
list_display = ('album_name', 'description', 'release_date', 'label', 'song_count',)
search_fields = ('album_name', 'description', 'label',)
list_filter = ('album_name', )
pass
class SongAdmin(admin.ModelAdmin):
list_display = ('song_title', 'song_length', 'lyrics', 'music_video',)
search_fields = ('song_title', 'lyrics',)
list_filter = ('song_title',)
pass
# registering the model and the admin is what tells
# Django that admin pages must be generated for the models specified
admin.site.register(Artist, ArtistAdmin)
admin.site.register(Album, AlbumAdmin)
admin.site.register(Song, SongAdmin)
\ No newline at end of file
# 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-23 13:26
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('about', '0002_auto_20230223_2103'),
]
operations = [
migrations.AlterField(
model_name='album',
name='release_date',
field=models.DateField(default=datetime.datetime(2023, 2, 23, 21, 26, 3, 151069)),
),
migrations.AlterField(
model_name='song',
name='song_length',
field=models.TimeField(default=datetime.datetime(2023, 2, 23, 21, 26, 3, 152069)),
),
]
# Generated by Django 3.2 on 2023-02-23 13:28
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('about', '0003_auto_20230223_2126'),
]
operations = [
migrations.AlterField(
model_name='album',
name='release_date',
field=models.DateField(default=datetime.datetime(2023, 2, 23, 21, 28, 11, 339665)),
),
migrations.AlterField(
model_name='song',
name='song_length',
field=models.TimeField(default=datetime.datetime(2023, 2, 23, 21, 28, 11, 340672)),
),
]
# Generated by Django 3.2 on 2023-02-23 14:26
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('about', '0004_auto_20230223_2128'),
]
operations = [
migrations.AlterField(
model_name='album',
name='release_date',
field=models.DateField(default=datetime.datetime(2023, 2, 23, 22, 26, 28, 608294)),
),
migrations.AlterField(
model_name='song',
name='song_length',
field=models.TimeField(default=datetime.datetime(2023, 2, 23, 22, 26, 28, 609292)),
),
]
# 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)
pass birth_name = models.CharField(max_length=50, unique=True, blank=True,)
bio = models.TextField(blank=True,)
def __str__(self):
return self.artist_name
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())
pass label = models.CharField(max_length=50, unique=True, blank=True,)
song_count = models.IntegerField(blank=True,)
def __str__(self):
return self.album_name
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(default=False)
lyrics = models.TextField(blank=True,)
def __str__(self):
return self.song_title
\ No newline at end of file
from django.contrib import admin
# Register your models here.
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