Files
muzak/playlist/models.py
T
mark 727cfc9a14 initial commit
No real output to terminal yet, but spotify api works. mostly.
2024-02-05 02:41:16 +01:00

31 lines
1.1 KiB
Python

from django.db import models
class Artist(models.Model):
id = models.CharField(primary_key=True, max_length=128)
name = models.CharField(max_length=255)
popularity = models.SmallIntegerField(null=True, blank=True)
genres = models.JSONField()
class Album(models.Model):
id = models.CharField(primary_key=True, max_length=128)
name = models.CharField(max_length=255)
artists = models.ManyToManyField(Artist)
album_type = models.CharField(max_length=255)
total_tracks = models.PositiveSmallIntegerField(null=True)
image = models.ImageField(upload_to="albums/")
class Track(models.Model):
id = models.CharField(primary_key=True, max_length=128)
title = models.CharField(max_length=255)
artists = models.ManyToManyField(Artist)
album = models.ForeignKey(Album, null=True, on_delete=models.SET_NULL)
explicit = models.BooleanField(default=False)
duration_ms = models.PositiveIntegerField(null=True)
popularity = models.PositiveIntegerField(null=True)
banter = models.TextField()
#class TrackFeatures(models.Model):