#29799: Allow registration and unregistration of lookups per field instances.
-------------------------------------+-------------------------------------
     Reporter:  Simon Charette       |                    Owner:  Can
                                     |  Sarıgöl
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  1
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Himanshu Balasamanta):

 @carltongibson , @charettes . I wanted to clarify exactly what all the
 scope of the ticket covers.
 As per my understanding,
 - Enable registration and remove a lookup for a particular instance as
 opposed to a class.
 - Enable lookups registered for the class to be unregistered (and maybe
 re-registered?) for instances of that class.

 Description of the functions would be as follows

 - get_lookups()
   - when called by a field instance, returns all class and instance
 lookups currently registered for that field instance
   - when called by a class, returns all class lookups currently registered
 for that class

 - register_lookup
   - when called by a field instance, registers the lookup for that field
 instance
   - when called by a class, registers the lookup for that class

 - unregister_lookup
 1. when called by a field instance,
    - if the lookup is already registered with the instance, it gets
 removed,
    - if the lookup is registered with the instance class, that particular
 instance is exempted
    - else throws error
 2. when called by a class, if the lookup is already registered with the
 class, it is removed. Else error is thrown.

 Doubts:
 1. Should class lookups that are unregistered for an instance be re-
 registered using the register_lookup method itself?
 2. Should there be a method to specifically get lookups that were
 registered for the instance and not the class?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29799#comment:6>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018009eccbee-2ffcb701-19b9-4b05-8b6b-0747a2fb7740-000000%40eu-central-1.amazonses.com.

Reply via email to