标签:
from django.core.exceptions import ObjectDoesNotExist try: disabledusers.objects.get(sAMAccountName=‘liu‘) except ObjectDoesNotExist: print ‘a‘
except modelname.DoesNotExist:
Django抛错不存在(DoesNotExist)
原文地址:http://www.cnblogs.com/dreamer-fish/p/5835465.html