Any insight into the reasoning behind this design decision? It seems to me that having obj.save()
return something, has only benefits (like method chai
Since this is the first result that I get when searching for "django return saved object", to compliment Andrew's answer, if you still want to return the saved object, instead of using:
ExampleModel(title=title).save()
which returns None, you'd use:
saved_instance = ExampleModel.objects.create(title=title)
And this works because ExampleModel.objects
is a Model Manager rather than an instance of the class, so it's not returning itself.