本文主要列举一下django orm中的常用查询的筛选方法: 大于.大于等于 小于.小于等于 in like is null / is not null 不等于/不包含于 其他模糊查询 model: 1 class User(AbstractBaseUser, PermissionsMixin): 2 uuid = ShortUUIDField(unique=True) 3 username = models.CharField(max_length=100, db_index=True, un…
models.py: from django.db import models class Human(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=32) age = models.IntegerField() birthday = models.DateField(auto_now_add=True) 在数据库中添加几条数据 在 Python 脚本中调用 Dj…