Update collections and attachment uploads
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user