From 40c6dee13a7eed074e98867924a7e56e771689f6 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 4 Oct 2012 13:10:22 +0200 Subject: [PATCH] migration fix --- ...ry_changed_at__add_field_entry_published_at_pl__add.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migdal/migrations/0005_auto__add_field_entry_changed_at__add_field_entry_published_at_pl__add.py b/migdal/migrations/0005_auto__add_field_entry_changed_at__add_field_entry_published_at_pl__add.py index 2110ee4..f8e8ee8 100644 --- a/migdal/migrations/0005_auto__add_field_entry_changed_at__add_field_entry_published_at_pl__add.py +++ b/migdal/migrations/0005_auto__add_field_entry_changed_at__add_field_entry_published_at_pl__add.py @@ -25,11 +25,13 @@ class Migration(SchemaMigration): if not db.dry_run: for entry in orm['migdal.Entry'].objects.all(): + update_info = {} if entry.published_pl: - entry.published_at_pl = entry.date + update_info['published_at_pl'] = entry.date if entry.published_en: - entry.published_at_en = entry.date - entry.save() + update_info['published_at_en'] = entry.date + update_info['changed_at'] = entry.date + orm['migdal.Entry'].objects.filter(pk=entry.pk).update(**update_info) def backwards(self, orm): -- 2.20.1