On Sun, Jun 15, 2008 at 1:40 AM, Szymon <[EMAIL PROTECTED]> wrote: > What I need to import to handle DoesNotExist in process_exception? > Because DoesNotExist is part of every single model, so I can't import > it from model, because I don't know which model raises exception.
from django.db import models try: AnyModel.objects.get(pk=nonexistant) except (models.ObjectDoesNotExist): do whatever It should work as long as AnyModel is a subclass of models.Model. Ronny --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---