mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 21:52:21 +01:00
25 lines
852 B
Python
25 lines
852 B
Python
from django.db import models
|
|
from django.conf import settings
|
|
|
|
|
|
class Song(models.Model):
|
|
user = models.ForeignKey(
|
|
settings.AUTH_USER_MODEL,
|
|
on_delete=models.SET_NULL,
|
|
blank=True,
|
|
null=True
|
|
)
|
|
artist = models.TextField()
|
|
title = models.TextField()
|
|
hash = models.TextField()
|
|
duration = models.IntegerField(help_text="track duration in seconds")
|
|
rg_gain = models.DecimalField(max_digits=9, decimal_places=6,
|
|
blank=True, null=True, help_text="replaygain gain level")
|
|
rg_peak = models.DecimalField(max_digits=9, decimal_places=6,
|
|
blank=True, null=True, help_text="replaygain peak level")
|
|
old_id = models.TextField(blank=True, null=True, default=None)
|
|
deleted = models.BooleanField(default=False)
|
|
|
|
def __str__(self):
|
|
return self.artist + ' - ' + self.title
|