from djongo import models



class KnowledgeCategory(models.Model):
    # 知识分类
    id = models.AutoField(primary_key=True)
    title = models.CharField("知识分类名称", max_length=32, default="")
    addtime = models.IntegerField("创建时间", default=0)
    uptime = models.IntegerField("创建时间", default=0)
    order = models.IntegerField("排序", default=0)
    is_use = models.IntegerField("是否启用", default=1)
    is_delete = models.IntegerField("是否删除", default=1)

    class Meta:
        db_table = "knowledge_category"


class KnowledgeManage(models.Model):
    # 知识管理
    id = models.AutoField(primary_key=True)
    category = models.IntegerField("知识分类", default=1)
    title = models.CharField("知识标题", max_length=32, default="")
    is_top = models.IntegerField("是否置顶", default=1)
    related_plan = models.CharField("相关作物", max_length=64, default="")
    addtime = models.IntegerField("创建时间", default=0)
    img = models.TextField("知识图片", default="")
    origin = models.TextField("知识来源", default="")
    content = models.TextField("内容详情", default="")
    is_delete = models.IntegerField("是否删除", default=1)

    class Meta:
        db_table = "knowledge_manage"


class Information(models.Model):
    # 研判信息
    id = models.AutoField(primary_key=True)
    title = models.CharField("标题", max_length=64, default="")
    content = models.TextField("详情", default="")
    user = models.IntegerField("发布人")
    addtime = models.IntegerField("创建时间", default=0)
    is_delete = models.IntegerField("是否删除", default=1)

    class Meta:
        db_table = "information"


