#10153 closed (fixed)
'gte' missing in get_db_prep_lookup lookup
Reported by: | gatwanagu | Owned by: | Andy Durdin |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.0 |
Severity: | Keywords: | queryset field lookup | |
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
When using a field lookup
(unit__gte=3)
there is an error "Related Field has invalid lookup: ..." raised, when using the field lookup
(unit__gt=3)it works fine.
Reason is that in db/models/fields/related.py in the function get_db_prep_lookup the lookup_type is cross checked against a list, and in this list 'gte' is missing.
Inserting 'gte' (and 'lte' to keep it synced) fixes the problem. There is a FIXME about this checking.
I don't understand what is the big difference in handling 'gt' to 'gte' and why 'gte' and 'lte' can't be inserted
Thanks
Günter
Attachments (2)
Change History (13)
comment:1 by , 16 years ago
Component: | Uncategorized → Database layer (models, ORM) |
---|
comment:2 by , 16 years ago
milestone: | → 1.1 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 16 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:5 by , 16 years ago
Owner: | set to |
---|
by , 16 years ago
Attachment: | related_field_lookup_patch_1.diff added |
---|
comment:6 by , 16 years ago
Has patch: | set |
---|
comment:7 by , 16 years ago
Needs tests: | set |
---|
comment:8 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 16 years ago
Attachment: | related_field_lookup_patch_1_test.diff added |
---|
Patch just containing a regression test
comment:9 by , 16 years ago
Needs tests: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
comment:10 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
added 'gte' and 'lte' to the list.