Bootstrap

Django多条件筛选查询

转自:https://www.jianshu.com/p/a86281df530e

Django多条件筛选查询

主模型只存在外键一对多关系

模型设计

# 快捷筛选状态
class Status(models.Model): order_number = models.PositiveIntegerField(unique=True, verbose_name='状态编号') status_tag = models.CharField(max_length=10, verbose_name='状态名称') class Meta: ordering = ['order_number', ] verbose_name = '事件选择' verbose_name_plural = verbose_name def __str__(self): return self.status_tag # 项目分类 class Project(models.Model
;