Change relative pk to photo_id

Brightcells 8 年之前
父节点
当前提交
b6ab791315
共有 6 个文件被更改,包括 12 次插入12 次删除
  1. 2 2
      group/models.py
  2. 5 5
      group/views.py
  3. 1 1
      message/models.py
  4. 2 2
      pay/models.py
  5. 1 1
      pay/views.py
  6. 1 1
      utils/redis/rkeys.py

+ 2 - 2
group/models.py

@@ -273,7 +273,7 @@ class GroupPhotoInfo(CreateUpdateMixin):
273 273
     @property
274 274
     def photo_data(self):
275 275
         return {
276
-            'photo_id': self.pk,
276
+            'photo_id': self.photo_id,
277 277
             'comment_num': self.comment_num,
278 278
             'thumbup_num': self.thumbup_num,
279 279
         }
@@ -290,7 +290,7 @@ class GroupPhotoInfo(CreateUpdateMixin):
290 290
             'group_default_avatar': group and group.group_default_avatar,
291 291
             'group_avatar': group and group.group_avatar_url,
292 292
             'group_from': group and group.group_from,
293
-            'photo_id': self.pk,
293
+            'photo_id': self.photo_id,
294 294
             'photo_url': self.photo_url,
295 295
             'photo_w': self.photo_w,
296 296
             'photo_h': self.photo_h,

+ 5 - 5
group/views.py

@@ -322,7 +322,7 @@ def flyimg_detail_api(request):
322 322
 
323 323
     # 群组照片校验
324 324
     try:
325
-        group_photo = GroupPhotoInfo.objects.get(pk=photo_id)
325
+        group_photo = GroupPhotoInfo.objects.get(photo_id=photo_id)
326 326
     except GroupPhotoInfo.DoesNotExist:
327 327
         return response(GroupPhotoStatusCode.GROUP_PHOTO_NOT_FOUND)
328 328
 
@@ -351,7 +351,7 @@ def comment_submit_api(request):
351 351
 
352 352
     # 群组照片校验
353 353
     try:
354
-        group_photo = GroupPhotoInfo.objects.get(pk=photo_id)
354
+        group_photo = GroupPhotoInfo.objects.get(photo_id=photo_id)
355 355
     except GroupPhotoInfo.DoesNotExist:
356 356
         return response(GroupPhotoStatusCode.GROUP_PHOTO_NOT_FOUND)
357 357
 
@@ -432,7 +432,7 @@ def thumbup_submit_api(request):
432 432
 
433 433
     # 群组照片校验
434 434
     try:
435
-        group_photo = GroupPhotoInfo.objects.get(pk=photo_id)
435
+        group_photo = GroupPhotoInfo.objects.get(photo_id=photo_id)
436 436
     except GroupPhotoInfo.DoesNotExist:
437 437
         return response(GroupPhotoStatusCode.GROUP_PHOTO_NOT_FOUND)
438 438
 
@@ -533,7 +533,7 @@ def thumbup_cancel_api(request):
533 533
 
534 534
     # 群组照片校验
535 535
     try:
536
-        group_photo = GroupPhotoInfo.objects.get(pk=photo_id)
536
+        group_photo = GroupPhotoInfo.objects.get(photo_id=photo_id)
537 537
     except GroupPhotoInfo.DoesNotExist:
538 538
         return response(GroupPhotoStatusCode.GROUP_PHOTO_NOT_FOUND)
539 539
 
@@ -667,7 +667,7 @@ def lensman_photo_price(request):
667 667
 
668 668
     # 群组照片校验
669 669
     try:
670
-        group_photo = GroupPhotoInfo.objects.get(pk=photo_id)
670
+        group_photo = GroupPhotoInfo.objects.get(photo_id=photo_id)
671 671
     except GroupPhotoInfo.DoesNotExist:
672 672
         return response(GroupPhotoStatusCode.GROUP_PHOTO_NOT_FOUND)
673 673
 

+ 1 - 1
message/models.py

@@ -59,7 +59,7 @@ class UserMessageInfo(CreateUpdateMixin):
59 59
 
60 60
     def msg_info(self, user_id=None):
61 61
         try:
62
-            group_photo = GroupPhotoInfo.objects.get(pk=self.photo_id)
62
+            group_photo = GroupPhotoInfo.objects.get(photo_id=self.photo_id)
63 63
         except GroupPhotoInfo.DoesNotExist:
64 64
             group_photo = {}
65 65
         return {

+ 2 - 2
pay/models.py

@@ -84,7 +84,7 @@ class OrderInfo(CreateUpdateMixin):
84 84
 
85 85
     def data(self, user_id=None):
86 86
         try:
87
-            group_photo = GroupPhotoInfo.objects.get(pk=self.photo_id)
87
+            group_photo = GroupPhotoInfo.objects.get(photo_id=self.photo_id)
88 88
         except GroupPhotoInfo.DoesNotExist:
89 89
             group_photo = None
90 90
         return {
@@ -104,7 +104,7 @@ class OrderInfo(CreateUpdateMixin):
104 104
     @property
105 105
     def lensdata(self, user_id=None):
106 106
         try:
107
-            group_photo = GroupPhotoInfo.objects.get(pk=self.photo_id)
107
+            group_photo = GroupPhotoInfo.objects.get(photo_id=self.photo_id)
108 108
         except GroupPhotoInfo.DoesNotExist:
109 109
             group_photo = None
110 110
         return {

+ 1 - 1
pay/views.py

@@ -37,7 +37,7 @@ def wx_order_create_api(request):
37 37
 
38 38
     # 群组照片校验
39 39
     try:
40
-        group_photo = GroupPhotoInfo.objects.get(pk=photo_id, status=True)
40
+        group_photo = GroupPhotoInfo.objects.get(photo_id=photo_id, status=True)
41 41
     except GroupPhotoInfo.DoesNotExist:
42 42
         return response(GroupPhotoStatusCode.GROUP_PHOTO_NOT_FOUND)
43 43
 

+ 1 - 1
utils/redis/rkeys.py

@@ -29,7 +29,7 @@ GROUP_USERS_DELETED_SET = 'group:users:deleted:set:%s'  # SET,群组用户移
29 29
 GROUP_USERS_QUIT_SET = 'group:users:quit:set:%s'  # SET,群组用户退出集合,group_id
30 30
 
31 31
 # 群组照片相关
32
-GROUP_PHOTO_DATA = 'group:photo:data:%s'  # STRING,群组数据记录,photo_id
32
+GROUP_PHOTO_DATA = 'group:photo:data:%s'  # STRING,群组数据记录,group_id
33 33
 GROUP_PHOTO_THUMB_UP = 'group:photo:thumb:up:%s:%s'  # STRING,群组照片用户点赞记录,photo_id、user_id
34 34
 GROUP_PHOTO_COMMENT_LIST = 'group:photo:comment:list:%s'  # STRING,群组照片用户评论列表,photo_id
35 35
 GROUP_PHOTO_THUMB_UP_LIST = 'group:photo:thumb:up:list:%s'  # STRING,群组照片用户点赞列表,photo_id