django/tests/modeltests/get_or_create
Carl Meyer 4e9a74b81d Revert "Fixed #16865 -- Made get_or_create use read database for initial get query."
Thanks to Jeremy Dunck for pointing out the problem with this change. If in a
single transaction, the master deletes a record and then get_or_creates a
similar record, under the new behavior the get_or_create would find the record
in the slave db and fail to re-create it, leaving the record nonexistent, which
violates the contract of get_or_create that the record should always exist
afterwards. We need to do everything against the master here in order to ensure
correctness.

This reverts commit 901af86550.
2012-09-19 11:15:12 -06:00
..
__init__.py Added Manager.get_or_create() 2006-06-07 00:09:29 +00:00
models.py [py3] Refactored __unicode__ to __str__. 2012-08-12 14:44:40 +02:00
tests.py Revert "Fixed #16865 -- Made get_or_create use read database for initial get query." 2012-09-19 11:15:12 -06:00