def folder_model(database):
class Folder(FieldSignatureMixin, ArchivedMixin):
# This class represents a Folder in a file system. Two Folders with
# the same name cannot exist in the same Folder. If the Folder has
# no Parent Folder, it exists in the top level of the file system.
name = peewee.CharField(max_length=255, null=False)
parent_folder = peewee.ForeignKeyField('self', null=True)
class Meta:
signature_fields = ('name', 'parent_folder')
Folder._meta.database = database.database
Folder.create_table(True)
return Folder
评论列表
文章目录