Форум сайта python.su
Хочу послать сигнал 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.
Офлайн
vaxXxaТак в комментарии написано – что объкт сохраняется “как есть”, без особой обработки отрибутов. Т.е. если например в объекте есть FK, то из него не будет автоматически взят id.
За что отвечает параметр raw?
Офлайн