l-201">
+ user_id=user_id,
+ )
+ photo_thumbup.thumbup = False
+ photo_thumbup.save()
+
+ photo_thumbups = PhotoThumbUpInfo.objects.filter(
+ photo_id=photo_id,
+ thumbup=True,
+ )
+
+ return JsonResponse({
+ 'status': 200,
+ 'message': u'点赞取消成功',
+ 'data': {
+ 'thumbup': False,
+ 'thumbups': [thumbup.thumbup_info for thumbup in photo_thumbups],
+ }
+ })
+
+
class GroupInfoViewSet(viewsets.ModelViewSet):
queryset = GroupInfo.objects.all().order_by('-created_at')
serializer_class = GroupInfoSerializer
@@ -1,10 +1,6 @@ |
||
| 1 | 1 |
# -*- coding: utf-8 -*- |
| 2 | 2 |
|
| 3 |
-from django.conf import settings |
|
| 4 |
-from django.core.files.storage import default_storage |
|
| 5 |
-from django.db import transaction |
|
| 6 | 3 |
from django.http import JsonResponse |
| 7 |
-from django.shortcuts import render, redirect |
|
| 8 | 4 |
|
| 9 | 5 |
from operation.models import LatestAppInfo, SplashInfo |
| 10 | 6 |
|