1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

[1.6.x] Fixed #11811 -- Data-loss bug in queryset.update.

It's now forbidden to call queryset.update(field=instance) when instance
hasn't been saved to the database ie. instance.pk is None.

Conflicts:
	tests/queries/tests.py

Backport of b4cd8169 from master.
This commit is contained in:
Aymeric Augustin
2013-09-06 17:13:51 -05:00
parent 2a2ac5c140
commit f855058c35
3 changed files with 15 additions and 1 deletions

View File

@@ -17,9 +17,13 @@ class ProxyCategory(DumbCategory):
class Meta:
proxy = True
@python_2_unicode_compatible
class NamedCategory(DumbCategory):
name = models.CharField(max_length=10)
def __str__(self):
return self.name
@python_2_unicode_compatible
class Tag(models.Model):
name = models.CharField(max_length=10)