From 5df8f749e6338c85a091f41803e6ecb280fc9f70 Mon Sep 17 00:00:00 2001 From: Loic Bistuer Date: Mon, 2 Sep 2013 01:21:08 +0700 Subject: [PATCH] Fixed #20978 -- Made deletion.SET_NULL more friendly for MigrationWriter.serialize. --- django/db/models/deletion.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py index 769e5b9bb6..6f89da7417 100644 --- a/django/db/models/deletion.py +++ b/django/db/models/deletion.py @@ -38,7 +38,8 @@ def SET(value): return set_on_delete -SET_NULL = SET(None) +def SET_NULL(collector, field, sub_objs, using): + collector.add_field_update(field, None, sub_objs) def SET_DEFAULT(collector, field, sub_objs, using):