X-Git-Url: https://git.mdrn.pl/audio.git/blobdiff_plain/1b434b4f4eb775a20054b0efeca3fea63a161879..c20c52d415f7cebb44fb06721bd5f6860c0616ee:/src/youtube/models.py?ds=inline diff --git a/src/youtube/models.py b/src/youtube/models.py index 356e335..df071f1 100644 --- a/src/youtube/models.py +++ b/src/youtube/models.py @@ -24,6 +24,7 @@ YOUTUBE_TITLE_LIMIT = 100 class YouTube(models.Model): + name = models.CharField(max_length=255) title_template = models.CharField(max_length=1024, blank=True) description_template = models.TextField(blank=True) category = models.IntegerField(null=True, blank=True, choices=[ @@ -44,6 +45,9 @@ class YouTube(models.Model): verbose_name = _("YouTube configuration") verbose_name_plural = _("YouTube configurations") + def __str__(self): + return self.name + def get_context(self, audiobook): return Context(dict( audiobook=audiobook, @@ -212,6 +216,7 @@ class Font(models.Model): class ThumbnailTemplate(models.Model): + youtube = models.ForeignKey(YouTube, models.CASCADE) order = models.SmallIntegerField() is_active = models.BooleanField() background = models.FileField(upload_to='youtube/thumbnail')