Flare-k

model 수정

Showing 28 changed files with 262 additions and 18 deletions
# Generated by Django 3.0.6 on 2020-05-28 11:05
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('cloud', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='file',
options={'ordering': ['createdDate']},
),
migrations.RemoveField(
model_name='file',
name='created_date',
),
migrations.RemoveField(
model_name='file',
name='modified_date',
),
migrations.AddField(
model_name='file',
name='createdDate',
field=models.DateTimeField(default=django.utils.timezone.now),
),
migrations.AddField(
model_name='file',
name='fileSize',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='file',
name='isFolder',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='file',
name='modifiedDate',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AddField(
model_name='file',
name='name',
field=models.CharField(default='', max_length=50, null=True),
),
migrations.AddField(
model_name='file',
name='owner',
field=models.CharField(default='', max_length=30, null=True),
),
migrations.AlterField(
model_name='file',
name='path',
field=models.TextField(),
),
]
# Generated by Django 3.0.6 on 2020-05-28 11:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cloud', '0002_auto_20200528_2005'),
]
operations = [
migrations.AlterField(
model_name='file',
name='fileSize',
field=models.IntegerField(default=0),
),
]
# Generated by Django 3.0.6 on 2020-05-28 11:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cloud', '0003_auto_20200528_2006'),
]
operations = [
migrations.AlterField(
model_name='file',
name='fileSize',
field=models.IntegerField(),
),
migrations.AlterField(
model_name='file',
name='isFolder',
field=models.BooleanField(),
),
migrations.AlterField(
model_name='file',
name='owner',
field=models.CharField(max_length=30),
),
]
# Generated by Django 3.0.6 on 2020-05-28 11:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cloud', '0004_auto_20200528_2010'),
]
operations = [
migrations.AlterField(
model_name='file',
name='owner',
field=models.CharField(default='', max_length=30, null=True),
),
]
# Generated by Django 3.0.6 on 2020-05-28 11:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cloud', '0005_auto_20200528_2011'),
]
operations = [
migrations.AlterModelOptions(
name='file',
options={},
),
]
# Generated by Django 3.0.6 on 2020-05-28 12:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cloud', '0006_auto_20200528_2054'),
]
operations = [
migrations.AlterModelOptions(
name='file',
options={'ordering': ['createdDate']},
),
migrations.AlterField(
model_name='file',
name='fileSize',
field=models.IntegerField(default=0),
),
]
# Generated by Django 3.0.6 on 2020-05-28 12:10
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cloud', '0007_auto_20200528_2109'),
]
operations = [
migrations.AlterModelOptions(
name='file',
options={'ordering': ('createdDate',)},
),
]
# Generated by Django 3.0.6 on 2020-05-28 12:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cloud', '0008_auto_20200528_2110'),
]
operations = [
migrations.RemoveField(
model_name='file',
name='fileSize',
),
migrations.AddField(
model_name='file',
name='filesize',
field=models.IntegerField(default=0),
),
]
# Generated by Django 3.0.6 on 2020-05-28 12:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cloud', '0009_auto_20200528_2112'),
]
operations = [
migrations.AlterField(
model_name='file',
name='filesize',
field=models.CharField(default='', max_length=30, null=True),
),
]
# Generated by Django 3.0.6 on 2020-05-28 12:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cloud', '0010_auto_20200528_2114'),
]
operations = [
migrations.AlterField(
model_name='file',
name='filesize',
field=models.IntegerField(default=0),
),
]
# Generated by Django 3.0.6 on 2020-05-28 12:19
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cloud', '0011_auto_20200528_2118'),
]
operations = [
migrations.AlterModelOptions(
name='file',
options={'ordering': ['createdDate']},
),
]
from django.db import models
from django.utils import timezone
# Create your models here.
class File(models.Model):
# file = models.FileField(upload_to=None, max_length=100) #일단 보류
name = models.CharField(max_length=50)
isFolder = models.BooleanField(default=False)
name = models.CharField(null=True, default='', max_length=50)
isFolder = models.BooleanField()
path = models.TextField()
owner = models.CharField(max_length=30)
fileSize = models.IntegerField()
createdDate = models.DateTimeField(auto_now_add=True)
owner = models.CharField(null=True, default='', max_length=30)
filesize = models.IntegerField(default=0)
createdDate = models.DateTimeField(default=timezone.now)
modifiedDate = models.DateTimeField(blank=True, null=True)
# file = models.FileField(upload_to=None, max_length=100) #일단 보류
class Meta:
ordering = ['createdDate']
......
from rest_framework import serializers
from .models import File
class FileSerializer(serializers.FileSerializer):
class Meta:
model = File
fields = ['file', 'name', 'isFolder', 'path', 'owner',
'fileSize', 'createdDate', 'modifiedDate']
......@@ -7,7 +7,6 @@ from django.http import HttpResponse
import boto3
import os
import json
from .files import *
from django.http import JsonResponse
# from cloud.aws import aws_key
import configparser
......