#29799: Allow registration and unregistration of lookups per field instances.
-------------------------------------+-------------------------------------
Reporter: Simon | Owner: nobody
Charette |
Type: New | Status: new
feature |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Under certain circumstances it might be useful to register or unregister
model field lookups on a per instance basis instead of a per class basis.
For example, it could be useful to disable costly lookups such as
`contains` and `icontains` on some large table model `CharField`s without
defining them using a `CharField` subclass to prevent them from being used
in production. Similarly you might want to register or override a specific
lookup for a third party app model field that doesn't allow swapping.
This was initially mentioned in #16187 which introduced this new lookup
registration system.
https://code.djangoproject.com/ticket/16187#comment:14
> Having the ability to hook a custom lookup to a given field instance
would be really nice to have...
https://code.djangoproject.com/ticket/16187#comment:22
> Add a way to register lookups to fields (I think either instances or
classes is wanted behaviour).
But not discussed afterwhile. I believe class based registration was
chosen because it was easier to implement but I agree that being able to
register custom lookups per field instance would be good feature addition.
--
Ticket URL: <https://code.djangoproject.com/ticket/29799>
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/052.59ef866a6dbc907df50bb7b73f27b1ce%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.