윤창목

모델 설계

from django.db import models
# Create your models here.
class Item(models.Model):
item_id = models.IntegerField(primary_key = True)
is_folder = models.BooleanField(default = False)
name = models.CharField(max_length = 50)
path = models.TextField()
parent = models.ForiegnKey(related_naem = 'items', on_delete=models.CASCADE) #related_name
user_id = models.IntegerField()
size = models.IntegerField()
is_deleted = models.BooleanField(default = False)
created_time = models.DateTimeField(blank = False)
updated_time = models.DateTimeField()
status = models.BooleanField()
#file = models.FileField(upload_to = \path)
class Meta:
ordering = ['item_id']
class SharedItem(models.Model):
item_id = models.IntegerField()
#file_id?
valid = models.DateTimeFIeld()
password = models.CharField(max_length = 20)
class Meta:
ordering = ['item_id']
class User(models.Model):
int_id = models.IntegerField()
user_id = models.CharField(max_length = 50)
name = models.CharField(max_length = 50)
password = models.CharField(max_length = 20)
total_size = models.IntegerField()
current_size = models.IntegerField()
class Meta:
ordering = ['int_id']
......