Collection item: rename isDeletion to deleted

This commit is contained in:
Tom Hacohen 2020-02-26 16:55:47 +02:00
parent f1bfb0a9a0
commit 0ee00e1a9f
4 changed files with 21 additions and 3 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 3.0.3 on 2020-02-26 14:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('django_etesync', '0016_auto_20200226_1446'),
]
operations = [
migrations.RenameField(
model_name='collectionitemrevision',
old_name='isDeletion',
new_name='deleted',
),
]

View File

@ -81,7 +81,7 @@ class CollectionItemRevision(models.Model):
chunks = models.ManyToManyField(CollectionItemChunk, related_name='items')
hmac = models.CharField(max_length=50, blank=False, null=False)
current = models.BooleanField(db_index=True, default=True, blank=True, null=True)
isDeletion = models.BooleanField(default=False)
deleted = models.BooleanField(default=False)
class Meta:
unique_together = ('item', 'current')

View File

@ -75,7 +75,7 @@ class CollectionItemRevisionBaseSerializer(serializers.ModelSerializer):
class Meta:
model = models.CollectionItemRevision
fields = ('version', 'encryptionKey', 'chunks', 'hmac', 'isDeletion')
fields = ('version', 'encryptionKey', 'chunks', 'hmac', 'deleted')
class CollectionItemRevisionSerializer(CollectionItemRevisionBaseSerializer):

View File

@ -112,7 +112,7 @@ class CollectionItemViewSet(BaseViewSet):
# XXX Potentially add this for performance: .prefetch_related('revisions__chunks')
queryset = type(self).queryset.filter(collection__pk=collection.pk,
revisions__current=True,
revisions__isDeletion=False)
revisions__deleted=False)
return queryset