📅  最后修改于: 2022-03-11 14:45:54.185000             🧑  作者: Mango
If using the object ---
try:
obj = model1.objects.get(pk=20)
except DoesNotExist:
###do something####
Else ----
if model1.objects.filter(pk=20).exists():
###do something###
else:
###do otherthing###