| 1276 | |
| 1277 | == `create()` and `get_or_create()` will never update existing objects == |
| 1278 | |
| 1279 | In [8670] a change was made to both `create()` and `get_or_create()` that affects people using manually specific primary keys on their models. There are two possible interpretations of what might happen if the key you passed into these functions already exists (in the case where the objects didn't already exist in the `get_or_create()` method). The previous behaviour was that, after the call returned, the data you passed in would always exist in the database and the object (and object with those values was always brought into existence). The side-effect here was that any existing row in the database with that primary key value was updated and this might have been unintended. |
| 1280 | |
| 1281 | The new behaviour is that these two methods will always create a new row in the database. If a row with that primary key value already exists, an exception is raised. |
| 1282 | |
| 1283 | For most people, this change will have no effect. It is only relevant if you are using custom primary key attributes and relying on the old behaviour as a way of keeping the data up to date if older values previously existed. You will now have to emulate that old behaviour manually (by calling `save()` on the model instance). |