#24313: Deprecate the class_prepared signal
--------------------------------------+------------------------------------
Reporter: aaugustin | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by AlexHill):
Yep `class_prepared` is no longer used anywhere in Django other than tests
AFAIK. Unless someone can outline a use that can't be implemented with
`AppConfig.ready()`, I agree with deprecating it because
* it's unlike other signals in that the trigger is generally expected to
happen only once per sender
* it's hard to make sure it's registered in the right place
Mezzanine uses `class_prepared` to add fields to models at boot time,
which sounds nasty but works surprisingly well. Until Django has a
sanctioned method of swapping models besides `auth.User`, we'll continue
to support this. I'll try to refactor it to use `AppConfig.ready()` and
see how that goes.
--
Ticket URL: <https://code.djangoproject.com/ticket/24313#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.8f4f9ff54b0b38fb528b657b0709be4e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.