Forward signals from proxy models to their concrete models

Hello! :wave:

In the documentation of Proxy models, we can find this sentence:

You can create, delete and update instances of the proxy model and all the data will be saved as if you were using the original (non-proxied) model.

I found that the actual signal sender is the Proxy model. A few years ago, @KenWhitesell discussed this same sentence and I agree that the concrete model should be the signal sender :point_down:

There’s also an open ticket about it: #9318 ("Virtual" behaviour for signal dispatcher and model inheritance) – Django.

Do you think this is a bug? :bug: If so, I’m interested in resolving it and I have a draft with the changes (missing tests for [pre|post]_init and documentation):

@KenWhitesell, could you take a look at this one?

I did, but this is one of those items that should be addressed by someone more knowledgeable than me.

There are actually three different possibilities here:

  • The docs and the code are both correct, and my interpretation of the situation is wrong.
  • My interpretation of the docs is correct, but the code is incorrect, in which case this is a bug needing to be addressed.
  • The code is correct, but the docs aren’t worded sufficiently precise, in which case this deserves a documentation update.

There’s also the side aspect that the code may be wrong according to the original intent, but current usage has gotten to the point that correcting the code now creates more issues for existing users than any reasonable benefit that would be obtained by fixing it after all this time, making it an appropriate decision to leave the code as-is.

But I don’t think I’m the right person to weigh in on this here.

1 Like

Thanks for answering. I’ll wait for someone else to chime in. Please tag anyone who you think can contribute to this discussion.