Opened 10 years ago
Closed 10 years ago
#23627 closed Cleanup/optimization (fixed)
Add a decorator for lookup registration.
Reported by: | Marc Tamlyn | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.7 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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
Change History (3)
comment:1 by , 10 years ago
Has patch: | set |
---|
comment:2 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:3 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In 92a17eaae081a213171b044858d6fc29df2df733: