Is it possible to catch the
global variable MultipleObjectsReturned does not exist
This isn't the best practice. You can technically do this without using exceptions. Did you intend to use
Car in this example?
You can do this:
I strongly suggest you read the Django QuerySet API reference.
To answer your question about where the exception exists -- you can always access these QuerySet exceptions on the model itself. E.g.
Location.MultipleObjectsReturned. You don't need to import them if you already have the model imported.