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?
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?