Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-CloudComputing-E
/
E_Team_KhuBox
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
서승완
2020-06-08 02:32:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
28197f90bcc66bc381cfc5c4906a5694b1518938
28197f90
1 parent
6c5a5c6e
feat: create models
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
103 additions
and
1 deletions
khubox-api/config/settings.py
khubox-api/khubox/migrations/0001_initial.py
khubox-api/khubox/models.py
khubox-api/config/settings.py
View file @
28197f9
...
...
@@ -31,6 +31,7 @@ ALLOWED_HOSTS = ['127.0.0.1', 'khubox-api.khunet.net']
# Application definition
INSTALLED_APPS
=
[
'khubox.apps.KhuboxConfig'
,
'django.contrib.admin'
,
'django.contrib.auth'
,
'django.contrib.contenttypes'
,
...
...
khubox-api/khubox/migrations/0001_initial.py
0 → 100644
View file @
28197f9
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-06-07 17:28
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
]
operations
=
[
migrations
.
CreateModel
(
name
=
'File'
,
fields
=
[
(
'id'
,
models
.
CharField
(
max_length
=
36
,
primary_key
=
True
,
serialize
=
False
)),
(
'parent_id'
,
models
.
CharField
(
blank
=
True
,
max_length
=
36
,
null
=
True
)),
(
'owner_user_id'
,
models
.
IntegerField
(
blank
=
True
,
null
=
True
)),
(
'owner_group_id'
,
models
.
IntegerField
(
blank
=
True
,
null
=
True
)),
(
'uploader_id'
,
models
.
IntegerField
(
blank
=
True
,
null
=
True
)),
(
'type'
,
models
.
CharField
(
max_length
=
6
)),
(
'name'
,
models
.
CharField
(
max_length
=
255
)),
(
'size'
,
models
.
BigIntegerField
()),
(
'is_public'
,
models
.
IntegerField
(
default
=
0
)),
(
'is_starred'
,
models
.
IntegerField
(
default
=
0
)),
(
'is_trahsed'
,
models
.
IntegerField
(
default
=
0
)),
(
'created_at'
,
models
.
DateTimeField
()),
(
'deleted_at'
,
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)),
],
),
migrations
.
CreateModel
(
name
=
'Group'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'owner_id'
,
models
.
IntegerField
()),
(
'name'
,
models
.
CharField
(
max_length
=
50
)),
(
'root_folder'
,
models
.
CharField
(
max_length
=
36
)),
(
'invite_code'
,
models
.
CharField
(
max_length
=
36
)),
(
'created_at'
,
models
.
DateTimeField
()),
],
),
migrations
.
CreateModel
(
name
=
'GroupUser'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'group_id'
,
models
.
IntegerField
()),
(
'user_id'
,
models
.
IntegerField
()),
(
'joined_at'
,
models
.
DateTimeField
()),
],
),
migrations
.
CreateModel
(
name
=
'User'
,
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'email'
,
models
.
CharField
(
max_length
=
255
)),
(
'password'
,
models
.
CharField
(
max_length
=
60
)),
(
'name'
,
models
.
CharField
(
max_length
=
50
)),
(
'root_folder'
,
models
.
CharField
(
max_length
=
36
)),
(
'created_at'
,
models
.
DateTimeField
()),
],
),
]
khubox-api/khubox/models.py
View file @
28197f9
from
django.db
import
models
# Create your models here.
class
File
(
models
.
Model
):
id
=
models
.
CharField
(
primary_key
=
True
,
max_length
=
36
)
parent_id
=
models
.
CharField
(
max_length
=
36
,
blank
=
True
,
null
=
True
)
owner_user_id
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
owner_group_id
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
uploader_id
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
type
=
models
.
CharField
(
max_length
=
6
)
name
=
models
.
CharField
(
max_length
=
255
)
size
=
models
.
BigIntegerField
()
is_public
=
models
.
IntegerField
(
default
=
0
)
is_starred
=
models
.
IntegerField
(
default
=
0
)
is_trahsed
=
models
.
IntegerField
(
default
=
0
)
created_at
=
models
.
DateTimeField
()
deleted_at
=
models
.
DateTimeField
(
blank
=
True
,
null
=
True
)
class
Group
(
models
.
Model
):
owner_id
=
models
.
IntegerField
()
name
=
models
.
CharField
(
max_length
=
50
)
root_folder
=
models
.
CharField
(
max_length
=
36
)
invite_code
=
models
.
CharField
(
max_length
=
36
)
created_at
=
models
.
DateTimeField
()
class
GroupUser
(
models
.
Model
):
group_id
=
models
.
IntegerField
()
user_id
=
models
.
IntegerField
()
joined_at
=
models
.
DateTimeField
()
class
User
(
models
.
Model
):
email
=
models
.
CharField
(
max_length
=
255
)
password
=
models
.
CharField
(
max_length
=
60
)
name
=
models
.
CharField
(
max_length
=
50
)
root_folder
=
models
.
CharField
(
max_length
=
36
)
created_at
=
models
.
DateTimeField
()
...
...
Please
register
or
login
to post a comment