Moves from_json to utils and splits the models to files in a module
This commit is contained in:
2024-02-06 15:31:05 +01:00
parent e7ee92868f
commit aad9343569
10 changed files with 132 additions and 111 deletions
+12
View File
@@ -0,0 +1,12 @@
from django.db import models
from .artist import Artist
class Album(models.Model):
def __str__(self):
return self.name
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/")