Commit 0ba13f5c authored by Brian Guadalupe's avatar Brian Guadalupe

Create app `playlist`

parent a0fb750d
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class PlaylistConfig(AppConfig):
name = 'playlist'
from django.db import models
from core.models import *
from user.models import *
class MusicPlaylist(models.Model):
id = models.AutoField(primary_key=True)
playlist_name = models.CharField(max_length=32)
is_public = models.BooleanField(default=False)
user = models.ForeignKey(UserAccount)
def __str__(self):
return self.playlist_name
class MusicEntry(models.Model):
RATING_CHOICES = (
(0,'1'),
(1,'2'),
(2,'3'),
(3,'4'),
(4,'5'),
(5,'6'),
(6,'7'),
(7,'8'),
(8,'9'),
(9,'10')
)
id = models.AutoField(primary_key=True)
order_in_playlist = models.PositiveSmallIntegerField()
rating = models.DecimalField(max_digits=1, decimal_places=0, choices=RATING_CHOICES)
playlist = models.ForeignKey(MusicPlaylist)
song = models.ForeignKey(Song)
\ No newline at end of file
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views 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