方式1: models.xx.objects.filter(Q(id=10)) models.xx.objects.filter(Q(id=10)&Q(age=10) # and models.xx.objects.filter(Q(id=10)|Q(age=10) # or models.xx.o Read More
posted @ 2022-09-14 16:04 角角边 Views(249) Comments(0) Diggs(0) Edit
常用模块导入 1 forms # forms组件的使用 from django import forms 2 ValidationError # modelform报错时使用 from django.core.exceptions import ValidationError 3 mark_safe Read More
posted @ 2022-09-14 16:04 角角边 Views(199) Comments(0) Diggs(0) Edit
import hashlib def gen_md5(origin): """md5加密""" ha = hashlib.md5(b'lkplkp123123') ha.update(origin.encode('utf-8')) return ha.hexdigest() Read More
posted @ 2022-09-14 15:29 角角边 Views(19) Comments(0) Diggs(0) Edit