Django抛错不存在(DoesNotExist)

from django.core.exceptions import ObjectDoesNotExist
try:
disabledusers.objects.get(sAMAccountName='liu')
except ObjectDoesNotExist:
print 'a'

except modelname.DoesNotExist:

上一篇:forward与redirect


下一篇:BZOJ3463 : [COCI2012] Inspector