from django.db import models
from folder.models import Folder


# 文件表
class File(models.Model):
    # 文件id
    file_id = models.AutoField(primary_key=True)
    # 文件名
    file_name = models.CharField(max_length=50, blank=False)
    # 从属的文件夹
    folder = models.ForeignKey(Folder, on_delete=models.CASCADE, related_name='file_folder')
    # 存储路径
    file_path = models.CharField(max_length=128)
    # 上传时间
    update_time = models.DateTimeField()
    # 文件类型
    file_type = models.CharField(max_length=32)
    # 文件大小
    file_size = models.CharField(max_length=16)
