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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user