#26640: class_prepared is not a ModelSignal and differs from documentation
----------------------------------------------+--------------------
Reporter: AlexHill | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
A few minor issues with class_prepared:
1. it's documented as a model signal, and so able to be called with lazy
references, but it isn't one and can't be.
> Model signals sender model can be lazily referenced when connecting a
receiver by specifying its full application label.
2. it's documented as being sent after the model is registered, but it's
actually sent just before
> Sent whenever a model class has been “prepared” – that is, once model
has been defined and registered with Django’s model system.
In `ModelBase.__new__()`:
{{{#!python
...
new_class._prepare() # class_prepared.send() is called at the end
of this method
new_class._meta.apps.register_model(new_class._meta.app_label,
new_class)
return new_class
}}}
3. it's instantiated with `providing_args=["class"]`, but it doesn't
provide a `class` argument
All three addressed in PR 6628.
--
Ticket URL: <https://code.djangoproject.com/ticket/26640>
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/051.aa926fa04501ebc71917bca691908cf5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.