diff options
author | Dan McGee <dan@archlinux.org> | 2013-02-09 16:43:40 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2013-02-09 16:50:45 -0600 |
commit | 5566d43a7734f6bb2f48d5d511351da12ddc5cc1 (patch) | |
tree | d575d2c100a039100771fdc9ed056d33da23b6c3 /releng/management | |
parent | 8524a6057c4b99a620850494a22eb3d1f56bee68 (diff) |
Use 'update_fields' model.save() kwarg
This was added in Django 1.5 and allows saving only a subset of a
model's fields. It makes sense in a few cases to utilize it.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'releng/management')
-rw-r--r-- | releng/management/commands/syncisos.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/releng/management/commands/syncisos.py b/releng/management/commands/syncisos.py index 223c771b..c9f61964 100644 --- a/releng/management/commands/syncisos.py +++ b/releng/management/commands/syncisos.py @@ -53,7 +53,7 @@ class Command(BaseCommand): if not existing.active: existing.active = True existing.removed = None - existing.save() + existing.save(update_fields=('active', 'removed')) # and then mark all other names as no longer active Iso.objects.filter(active=True).exclude(name__in=active_isos).update( active=False, removed=now()) |