Opened 11 years ago
Closed 11 years ago
#22806 closed Cleanup/optimization (invalid)
Some lookups/transforms don't have lookup_name
| Reported by: | jorgecarleitao | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.postgres | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
because RegisterLookupMixin.register_lookup requires the lookup to have a lookup_name, any transformation or lookup without it raises an AttributeError when registered.
in contrib.postgres.fields.array, some Transforms don't have lookup_name defined.
One will have to check out if we are missing any other.
Change History (4)
comment:1 by , 11 years ago
| Component: | Database layer (models, ORM) → contrib.postgres |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 11 years ago
comment:3 by , 11 years ago
| Type: | Bug → Cleanup/optimization |
|---|
I reported this when I was writing the API references of lookups. Only later I understood that only Transform and Lookup are to be registered (now documented). So, this is now more a cleanup / internals consistency than a bug. I changed it accordingly. Maybe it is not a ticket at all at the moment.
comment:4 by , 11 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
OK, I'm going to close this for now as I don't think it is an issue in this case. If someone has a genuine use case then we can add it, but I believe the way they are written means they cannot be used directly with register_lookup because their __init__ signature is wrong - you need the factory.
IndexTransformandSliceTransformdo not havelookup_namedefined at the moment. However they are not designed to be registered usingregister_lookupat the moment. I guess this could be a reasonable use case on a third party field somehow?Can you expand on why this is causing you a problem?