Select on save (1.6 version) #1522

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants
Member

akaariai commented Aug 28, 2013

No description provided.

akaariai added some commits Aug 16, 2013

[1.6.x] Fixed #20988 -- Added model meta option select_on_save
The option can be used to force pre 1.6 style SELECT on save behaviour.
This is needed in case the database returns zero updated rows even if
there is a matching row in the DB. One such case is PostgreSQL update
trigger that returns NULL.

Refs #16649

Backpatch of f65c814 from master.

Conflicts:
	django/db/models/options.py
	tests/basic/tests.py
+ Determines if Django will use the pre-1.6
+ :meth:`django.db.models.Model.save()` algorithm. The old algorithm
+ uses ``SELECT`` to determine if there is an existing row to be updated.
+ The new algorith tries an ``UPDATE`` directly. In some rare cases the
@EnTeQuAk

EnTeQuAk Aug 30, 2013

Contributor

algorithm

Owner

timgraham commented Aug 31, 2013

merged in 76e38a2 (also fixed typo pointed out by @EnTeQuAk)

@timgraham timgraham closed this Aug 31, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment