Reputation: 1389
When I instantiate the model, I usually used the manager, e.g.
user = User.objects.create_objects(name='Tom', age='25')
but, sometime I can also see the code like,
user = User(name='Tom', age='25')
Are these two identical codes?
Upvotes: 0
Views: 33
Reputation: 77902
not quite... in the first case the object is immediately written in the database, in the second one it is not until you explicitly save it.
Upvotes: 1