When I ask the model manager to get an object, it raises DoesNotExist when there is no matching object.

go = Content.objects.get(name="baby")

Instead of DoesNotExist, how can I have go be None instead?

20 Answers
20

Leave a Reply

Your email address will not be published. Required fields are marked *