1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #35073 -- Avoided unnecessary calling of callables used by SET/SET_DEFAULT in Collector.collect().

This commit is contained in:
bcail
2024-02-08 17:41:32 +00:00
committed by GitHub
parent 1b5338d03e
commit 9c5e382b98
3 changed files with 32 additions and 10 deletions

View File

@@ -60,8 +60,9 @@ def SET(value):
def set_on_delete(collector, field, sub_objs, using):
collector.add_field_update(field, value, sub_objs)
set_on_delete.lazy_sub_objs = True
set_on_delete.deconstruct = lambda: ("django.db.models.SET", (value,), {})
set_on_delete.lazy_sub_objs = True
return set_on_delete
@@ -76,9 +77,6 @@ def SET_DEFAULT(collector, field, sub_objs, using):
collector.add_field_update(field, field.get_default(), sub_objs)
SET_DEFAULT.lazy_sub_objs = True
def DO_NOTHING(collector, field, sub_objs, using):
pass