feat(api): rename track type to library
Related to #1922 - rename library model fields
This commit is contained in:
parent
e5cb21c0e2
commit
05ca410453
14 changed files with 289 additions and 274 deletions
|
@ -1,3 +1,3 @@
|
|||
from .cloud_file import CloudFile
|
||||
from .file import File
|
||||
from .track_type import TrackType
|
||||
from .library import Library
|
||||
|
|
|
@ -2,6 +2,13 @@ from django.db import models
|
|||
|
||||
|
||||
class File(models.Model):
|
||||
library = models.CharField(
|
||||
max_length=16,
|
||||
blank=True,
|
||||
null=True,
|
||||
db_column="track_type",
|
||||
)
|
||||
|
||||
name = models.CharField(max_length=255)
|
||||
mime = models.CharField(max_length=255)
|
||||
ftype = models.CharField(max_length=128)
|
||||
|
@ -82,7 +89,6 @@ class File(models.Model):
|
|||
filesize = models.IntegerField()
|
||||
description = models.CharField(max_length=512, blank=True, null=True)
|
||||
artwork = models.CharField(max_length=512, blank=True, null=True)
|
||||
track_type = models.CharField(max_length=16, blank=True, null=True)
|
||||
|
||||
def get_owner(self):
|
||||
return self.owner
|
||||
|
|
21
api/libretime_api/storage/models/library.py
Normal file
21
api/libretime_api/storage/models/library.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
class Library(models.Model):
|
||||
name = models.CharField(
|
||||
max_length=255,
|
||||
blank=True,
|
||||
null=True,
|
||||
db_column="type_name",
|
||||
)
|
||||
code = models.CharField(max_length=16, unique=True)
|
||||
description = models.CharField(max_length=255, blank=True, null=True)
|
||||
visible = models.BooleanField(
|
||||
blank=True,
|
||||
default=True,
|
||||
db_column="visibility",
|
||||
)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_track_types"
|
|
@ -1,12 +0,0 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
class TrackType(models.Model):
|
||||
code = models.CharField(max_length=16, unique=True)
|
||||
type_name = models.CharField(max_length=255, blank=True, null=True)
|
||||
description = models.CharField(max_length=255, blank=True, null=True)
|
||||
visibility = models.BooleanField(blank=True, default=True)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cc_track_types"
|
Loading…
Add table
Add a link
Reference in a new issue