#23627: Add a decorator for lookup registration.
-------------------------------------+-------------------------------------
               Reporter:  mjtamlyn   |          Owner:  nobody
                   Type:             |         Status:  new
  Cleanup/optimization               |        Version:  1.7
              Component:  Database   |       Keywords:
  layer (models, ORM)                |      Has patch:  0
               Severity:  Normal     |    Needs tests:  0
           Triage Stage:  Accepted   |  Easy pickings:  0
    Needs documentation:  0          |
Patch needs improvement:  0          |
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Instead of:

 {{{
 class MyLookup(Lookup):
     lookup_name = 'foo'
     ...

 MyField.register_lookup(MyLookup)
 }}}

 Allow:

 {{{
 @MyField.register_lookup
 class MyLookup(Lookup):
     lookup_name = 'foo'
     ...
 }}}

 I guess we should be able to convert the existing function to work
 properly for both. We need to then use this functionality everywhere we do
 lookup registration.

 Proposed by Aymeric and +1 from Anssi in
 https://github.com/django/django/pull/3219

--
Ticket URL: <https://code.djangoproject.com/ticket/23627>
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.4a108bd5799d40ad5b0d7f8de0210d86%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to