Commit 839a1d41 authored by exclamationpoints's avatar exclamationpoints

Removed models for about and contact apps

parent 44be25ba
Pipeline #2693 canceled with stages
# Generated by Django 4.1.6 on 2023-02-13 14:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('about', '0003_alter_artist_monthly_listeners'),
]
operations = [
migrations.RemoveField(
model_name='song',
name='album',
),
migrations.RemoveField(
model_name='song',
name='artist',
),
migrations.DeleteModel(
name='Album',
),
migrations.DeleteModel(
name='Artist',
),
migrations.DeleteModel(
name='Song',
),
]
......@@ -5,36 +5,3 @@ from django.db import models
from django.db import models
from django.urls import reverse
class Artist(models.Model):
artist_name = models.CharField(max_length=100, unique=True)
monthly_listeners = models.IntegerField()
def __str__(self):
return '{}'.format(self.artist_name, self.monthly_listeners)
def get_absolute_url(self):
return reverse('artist_detail', args=[str(self.artist_name)])
class Album(models.Model):
album_name = models.CharField(max_length=100)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE, related_name='albums')
description = models.CharField(max_length=255)
release_date = models.DateField()
def __str__(self):
return '{} by {}'.format(self.album_name, self.artist)
def get_absolute_url(self):
return reverse('album_detail', args=[str(self.album_name)])
class Song(models.Model):
song_title = models.CharField(max_length=100)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE, related_name='songs')
album = models.ForeignKey(Album, on_delete=models.CASCADE, related_name='songs')
song_length = models.DurationField()
def __str__(self):
return '{} - {}'.format(self.artist, self.song_title)
def get_absolute_url(self):
return reverse('song_detail', args=[str(self.song_title)])
# Generated by Django 4.1.6 on 2023-02-13 14:37
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contact', '0003_alter_artist_monthly_listeners'),
]
operations = [
migrations.RemoveField(
model_name='song',
name='album',
),
migrations.RemoveField(
model_name='song',
name='artist',
),
migrations.DeleteModel(
name='Album',
),
migrations.DeleteModel(
name='Artist',
),
migrations.DeleteModel(
name='Song',
),
]
......@@ -3,38 +3,4 @@ from django.db import models
# Create your models here.
from django.db import models
from django.urls import reverse
class Artist(models.Model):
artist_name = models.CharField(max_length=100, unique=True)
monthly_listeners = models.IntegerField()
def __str__(self):
return '{}'.format(self.artist_name, self.monthly_listeners)
def get_absolute_url(self):
return reverse('artist_detail', args=[str(self.artist_name)])
class Album(models.Model):
album_name = models.CharField(max_length=100)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE, related_name='albums')
description = models.CharField(max_length=255)
release_date = models.DateField()
def __str__(self):
return '{} by {}'.format(self.album_name, self.artist)
def get_absolute_url(self):
return reverse('album_detail', args=[str(self.album_name)])
class Song(models.Model):
song_title = models.CharField(max_length=100)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE, related_name='songs')
album = models.ForeignKey(Album, on_delete=models.CASCADE, related_name='songs')
song_length = models.DurationField()
def __str__(self):
return '{} - {}'.format(self.artist, self.song_title)
def get_absolute_url(self):
return reverse('song_detail', args=[str(self.song_title)])
from django.urls import reverse
\ 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