Collection: lax the restrictions on mainItem.

This commit is contained in:
Tom Hacohen
2020-04-15 16:00:06 +03:00
parent 963dc3c62d
commit c589d06cbe
3 changed files with 39 additions and 1 deletions

View File

@@ -29,7 +29,7 @@ class Collection(models.Model):
max_length=44, validators=[UidValidator])
version = models.PositiveSmallIntegerField()
owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
mainItem = models.OneToOneField('CollectionItem', related_name='of_collection', on_delete=models.PROTECT)
mainItem = models.OneToOneField('CollectionItem', related_name='of_collection', null=True, on_delete=models.SET_NULL)
class Meta:
unique_together = ('uid', 'owner')