Python – Django Model() vs Model.objects.create()


What it the difference between running two commands:

foo = FooModel()


bar = BarModel.objects.create()

Does the second one immediately create a BarModel in the database, while for FooModel, the save() method has to be called explicitly to add it to the database?

Best Answer

To create and save an object in a single step, use the create() method.

Related Question