upload photo with photo_id

Brightcells 9 lat temu
rodzic
commit
e7d461ade5
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      photo/views.py

+ 3 - 2
photo/views.py

@@ -62,10 +62,11 @@ def uuid(request):
62 62
 #               name with the symbol <. The difference between @ and < is then that @ makes a file get attached in the post as a file  upload,
63 63
 #               while the < makes a text field and just get the contents for that text field from a file.
64 64
 #
65
-# curl -X POST -F user=xxxxxxx -F session=xxxxxxx -F photo=@xxxxxxx.jpg http://api.xfoto.com.cn/photos/upload
65
+# curl -X POST -F user=xxxxxxx -F session=xxxxxxx -F photo_id=xxxxxxx -F photo=@xxxxxxx.jpg http://api.xfoto.com.cn/photos/upload
66 66
 def upload_photo(request):
67 67
     lensman_id = request.POST.get('user', '')
68 68
     session_id = request.POST.get('session', '')
69
+    photo_id = request.POST.get('photo_id', '')
69 70
 
70 71
     photo = request.FILES.get('photo', '')
71 72
 
@@ -83,7 +84,7 @@ def upload_photo(request):
83 84
             'message': u'摄影师不存在',
84 85
         })
85 86
 
86
-    photo_id = curtailUUID(PhotosInfo, 'photo_id')
87
+    # photo_id = curtailUUID(PhotosInfo, 'photo_id')
87 88
 
88 89
     _, extension = os.path.splitext(photo.name)
89 90
     m_photo_path = 'photo/{uuid}{extension}'.format(uuid=shortuuid.uuid(), extension=extension)