Changes between Initial Version and Version 1 of Ticket #27340, comment 4


Ignore:
Timestamp:
Oct 26, 2016, 1:15:19 PM (8 years ago)
Author:
Ask Solem Hoel

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27340, comment 4

    initial v1  
    88With the proposed change we'd be able to avoid doing two database queries for every Model.save by doing this:
    99
    10  
     10 {{{
    1111@signals.pre_init.connect
    1212def _track_changes(instance, args, kwargs, **kwargs):
    1313    instance._original_args = args, kwargs
     14}}}
    1415
    1516There's no other way as far as I can find, as we don't want to monkeypatch Model, and in any case it's very strange that the pre_init signal omits the instance being created.
Back to Top