Найти - Пользователи
Полная версия: Сигнал pre_save(). За что отвечает параметр raw?
Начало » Django » Сигнал pre_save(). За что отвечает параметр raw?
1
vaxXxa
Хочу послать сигнал pre_save()
Делаю как-то так:
models.signals.pre_save.send(sender=Order, instance=new_order)
В коде джанго нашел вот еще:

signals.pre_save.send(sender=origin, instance=self, raw=raw)

# If we are in a raw save, save the object exactly as presented.
# That means that we don't try to be smart about saving attributes
# that might have come from the parent class - we just save the
# attributes we have been given to the class we have been given.
# We also go through this process to defer the save of proxy objects
# to their actual underlying model.
За что отвечает параметр raw?
Александр Кошелев
vaxXxa
За что отвечает параметр raw?
Так в комментарии написано – что объкт сохраняется “как есть”, без особой обработки отрибутов. Т.е. если например в объекте есть FK, то из него не будет автоматически взят id.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB