# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
#
-from datetime import datetime
+from datetime import datetime, timezone
from django.db.models import Q
from django.http import Http404
-from django.utils.timezone import now, utc
+from django.utils.timezone import now
from rest_framework.exceptions import MethodNotAllowed
from rest_framework.generics import ListAPIView, ListCreateAPIView, RetrieveAPIView, RetrieveUpdateAPIView, RetrieveUpdateDestroyAPIView, get_object_or_404
from rest_framework.permissions import SAFE_METHODS, IsAuthenticated, IsAuthenticatedOrReadOnly
from social import models
import bookmarks.models
from . import serializers
-from bookmarks.api.views import BookmarkSerializer
+from bookmarks.api.views import BookmarkSerializer, QuoteSerializer
except:
timestamp = 0
- timestamp = datetime.fromtimestamp(timestamp, tz=utc)
+ timestamp = datetime.fromtimestamp(timestamp, tz=timezone.utc)
data = []
return self.get_queryset_for_ts(timestamp)
if data.get('location'):
ret = self.model.get_by_location(user, data['location'])
return ret
+
+
+class QuoteSyncView(SyncView):
+ model = bookmarks.models.Quote
+ serializer_class = QuoteSerializer
+
+ sync_id_field = 'uuid'
+ sync_id_serializer_field = 'uuid'