summaryrefslogtreecommitdiff
path: root/tests/basic/models.py
diff options
context:
space:
mode:
authorAnssi Kääriäinen <akaariai@gmail.com>2013-08-30 09:41:07 +0300
committerAnssi Kääriäinen <akaariai@gmail.com>2013-08-30 09:47:34 +0300
commit76e38a21777243fec58c640d617bb71a251c5ba1 (patch)
tree5a14a0f8c788649a97fffac96ed487c853fee603 /tests/basic/models.py
parentcd10e998b6a8f9daaf2e25cad55f33f3df51ea88 (diff)
[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. Reviewed by Tim Graham. Refs #16649 Backport of e973ee6a9879969b8ae05bb7ff681172cc5386a5 from master Conflicts: django/db/models/options.py tests/basic/tests.py
Diffstat (limited to 'tests/basic/models.py')
-rw-r--r--tests/basic/models.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/basic/models.py b/tests/basic/models.py
index 1bffcb9cda..ee44c1658a 100644
--- a/tests/basic/models.py
+++ b/tests/basic/models.py
@@ -19,6 +19,11 @@ class Article(models.Model):
def __str__(self):
return self.headline
+class ArticleSelectOnSave(Article):
+ class Meta:
+ proxy = True
+ select_on_save = True
+
@python_2_unicode_compatible
class SelfRef(models.Model):
selfref = models.ForeignKey('self', null=True, blank=True,