From 0ee00e1a9fff8e3b7a2fd0855b3b12665614a7e8 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Wed, 26 Feb 2020 16:55:47 +0200 Subject: [PATCH] Collection item: rename isDeletion to deleted --- .../migrations/0017_auto_20200226_1455.py | 18 ++++++++++++++++++ django_etesync/models.py | 2 +- django_etesync/serializers.py | 2 +- django_etesync/views.py | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 django_etesync/migrations/0017_auto_20200226_1455.py diff --git a/django_etesync/migrations/0017_auto_20200226_1455.py b/django_etesync/migrations/0017_auto_20200226_1455.py new file mode 100644 index 0000000..2148123 --- /dev/null +++ b/django_etesync/migrations/0017_auto_20200226_1455.py @@ -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', + ), + ] diff --git a/django_etesync/models.py b/django_etesync/models.py index 4577efb..1792031 100644 --- a/django_etesync/models.py +++ b/django_etesync/models.py @@ -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') diff --git a/django_etesync/serializers.py b/django_etesync/serializers.py index a576b6d..8736a02 100644 --- a/django_etesync/serializers.py +++ b/django_etesync/serializers.py @@ -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): diff --git a/django_etesync/views.py b/django_etesync/views.py index b1bb18b..3d27e72 100644 --- a/django_etesync/views.py +++ b/django_etesync/views.py @@ -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