+ def get_description(self):
+ if self.description:
+ return self.description
+ return "Audiobook nagrany w ramach projektu %s%s." % (
+ self.name,
+ " finansowanego przez %s" % self.sponsors if self.sponsors else "",
+ )
+
+
+class Piece(models.Model):
+ name = models.CharField(max_length=255)
+ source_file = models.FileField(upload_to='piece')
+ is_outro = models.BooleanField(default=False)
+ min_audiobook_duration = models.IntegerField(default=0)
+
+ def __str__(self):
+ return self.name
+