﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27340	Model pre_init signal should provide an `instance` argument	Ask Solem Hoel	nobody	"I struggle to find reasons as to why this argument is ommitted.

The current signature for pre_init is:

{{{
class Model(six.with_metaclass(ModelBase)):
    _deferred = False

    def __init__(self, *args, **kwargs):
        signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs)
}}}

I suggest that the signature should be:

{{{
class Model(six.with_metaclass(ModelBase)):
    _deferred = False

    def __init__(self, *args, **kwargs):
        signals.pre_init.send(sender=self.__class__, args=args, kwargs=kwargs, instance=self)
}}}

Or alternatively, that the `post_init` signal contains the args and kwargs used to construct the model.

The reason for wanting access to the instance in pre_init is that I want to track changes
to the model since it was first retrieved from the database - This is currently not possible without subclassing Model,
and that is not a realistic option for us as we deal with third party models.

The current way we handle this is by using `pre_save` to fetch the row from the database again, but this is suboptimal
and this a simple change would allow us to do this."	New feature	closed	Database layer (models, ORM)	1.10	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
