1
0
mirror of https://github.com/django/django.git synced 2024-12-25 10:35:48 +00:00

Minor factorization.

This commit is contained in:
Aymeric Augustin 2013-09-06 17:06:58 -05:00
parent 122020fdb9
commit 73f38eb4d1

View File

@ -153,10 +153,7 @@ class UpdateQuery(Query):
Updates are coalesced so that we only run one update query per ancestor.
"""
try:
self.related_updates[model].append((field, None, value))
except KeyError:
self.related_updates[model] = [(field, None, value)]
self.related_updates.setdefault(model, []).append((field, None, value))
def get_related_updates(self):
"""