Update collections and attachment uploads

This commit is contained in:
rucki
2026-09-03 13:59:02 +02:00
parent 28e17a4b21
commit d97244de40
9 changed files with 337 additions and 24 deletions
+8
View File
@@ -199,6 +199,14 @@ class Collection(models.Model):
class Mode(models.TextChoices):
MANUAL = 'manual', _('Manual collection')
TAGS = 'tags', _('Tag collection')
TUTORIAL = 'tutorial', _('Tutorial')
CHAPTER = 'chapter', _('Chapter')
STRUCTURED_MODES = {Mode.MANUAL, Mode.TUTORIAL, Mode.CHAPTER}
@property
def is_structured(self):
return self.mode in self.STRUCTURED_MODES
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name='collections')
team = models.ForeignKey(Team, on_delete=models.SET_NULL, blank=True, null=True, related_name='collections')