jshong0907
Committed by 서승완

trash api

...@@ -81,9 +81,6 @@ DATABASES = { ...@@ -81,9 +81,6 @@ DATABASES = {
81 'PASSWORD': '8f13dd391805db193227d3544b570b69', 81 'PASSWORD': '8f13dd391805db193227d3544b570b69',
82 'HOST': 'khubox.cogff6stbbkv.ap-northeast-2.rds.amazonaws.com', 82 'HOST': 'khubox.cogff6stbbkv.ap-northeast-2.rds.amazonaws.com',
83 'PORT': '3306', 83 'PORT': '3306',
84 - 'OPTIONS': {
85 - 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"
86 - }
87 } 84 }
88 } 85 }
89 86
......
1 +from rest_framework import serializers
2 +from .models import File
3 +
4 +
5 +class FileSerializer(serializers.ModelSerializer):
6 + class Meta:
7 + model = File
8 + fields = ['id', 'parent_id', 'owner_id', 'uploader_id', 'type', 'name', 'size', 'is_public', 'is_shared',
9 + 'is_starred', 'is_trahsed', 'created_at']
...\ No newline at end of file ...\ No newline at end of file
1 +from django.conf.urls import url
2 +from rest_framework.urlpatterns import format_suffix_patterns
3 +from . import views
4 +
5 +# API endpoints
6 +urlpatterns = format_suffix_patterns([
7 + url(r'^folders/(?P<pk>\w+)/$', views.FolderRequest.as_view()),
8 + url(r'^folders/$', views.FolderRequest.as_view()),
9 + url(r'^files/', views.StarredFiles.as_view()),
10 + url(r'^files/starred/(?P<pk>\w+).$', views.StarredFiles.as_view()),
11 + url(r'^trash/(?P<pk>\w+)/$', views.TrashReqeust.as_view()),
12 + url(r'^trash/$', views.FolderRequest.as_view()),
13 +])
...\ No newline at end of file ...\ No newline at end of file
...@@ -36,5 +36,3 @@ Werkzeug==0.16.1 ...@@ -36,5 +36,3 @@ Werkzeug==0.16.1
36 wsgi-request-logger==0.4.6 36 wsgi-request-logger==0.4.6
37 zappa==0.51.0 37 zappa==0.51.0
38 zipp==3.1.0 38 zipp==3.1.0
39 -djangorestframework == 3.11.0
40 -django-rest-knox == 1.1.0
......
1 from django.contrib import admin 1 from django.contrib import admin
2 +from khubox.models import *
2 3
3 # Register your models here. 4 # Register your models here.
5 +admin.site.register(File)
...\ No newline at end of file ...\ No newline at end of file
......