from django.db import models

# 文件夹表
from django.db.models import SET_NULL


class Folder(models.Model):
    # 文件夹id
    folder_id = models.AutoField(primary_key=True)
    # 文件夹名
    folder_name = models.CharField(max_length=50, blank=False, default='root')
    # 父节点
    father_folder = models.ForeignKey('self', blank=True, on_delete=SET_NULL, null=True,
                                      related_name='the_father_folder')

    def __unicode__(self):
        return self.folder_id

