권주희

Merge branch 'develop' into 'master'

Develop



See merge request !15
......@@ -232,6 +232,7 @@ class ItemViewSet(viewsets.ViewSet):
return Response({'message': 'delete permanently complete'}, status=status.HTTP_200_OK)
return Response({'message': 'item is not existed.'}, status=status.HTTP_204_NO_CONTENT)
# url: items/11/move
# 마지막 slash도 써주어야함
@action(methods=['POST'], detail=True, permission_classes=[AllowAny], url_path='move', url_name='move')
......@@ -337,6 +338,22 @@ class ItemViewSet(viewsets.ViewSet):
res['inside_file_list'] = []
return Response({'data': res}, status=status.HTTP_200_OK)
@action(methods=['GET'], detail=False, permission_classes=[AllowAny],
url_path='trash', url_name='trash')
def trash(self, request):
if request.method == 'GET':
children = Item.objects.filter(is_deleted = True)
children_data = serializers.serialize("json", children)
json_children = json.loads(children_data)
res = {}
children_list = []
for i in json_children:
t = i['fields']
t['id'] = i['pk']
children_list.append(t)
res['list'] = children_list
return Response({'data': res}, status=status.HTTP_200_OK)
# url: /upload/
@action(methods=['POST'], detail=True, permission_classes=[AllowAny],
url_path='upload', url_name='upload')
......
......@@ -88,9 +88,9 @@ DATABASES = {
# }
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'khuDrive',
'USER': 'root',
'PASSWORD': '1234',
'NAME': 'drive',
'USER': 'jooheekwon',
'PASSWORD': 'victoriawngml77',
'HOST': 'localhost',
'PORT': '',
}
......
......@@ -36,6 +36,7 @@ urlpatterns = [
url(r'^<int:pk>/move/$', views.ItemViewSet.move, name='move'),
url(r'^<int:pk>/copy/$', views.ItemViewSet.copy, name='copy'),
url(r'^<int:pk>/children/$', views.ItemViewSet.children, name='children'),
url(r'^trash/$', views.ItemViewSet.trash, name='trash'),
url(r'^signup/$', views.UserViewSet.signup, name='signup'),
url(r'^login/$', views.UserViewSet.login, name='login'),
url(r'^upload/$', views.ItemViewSet.upload, name='upload'),
......