#2616 closed enhancement (wontfix)
Add DB API support for lookup against IP address fields
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
please add an additional key word for querysets when searching with the inet datatype..
and example would be
assume a table constructed as follows.
create table network_interfaces(
id serial,
ip inet,
interface char(20)
)
--The SQL Syntax ---
SELECT * from network_interface where ip << '10.210.0.0/16';
--possible Django syntax ---
Interfaces.objects.filter(ip_within='10.210.0.0/16')
Thanks. Django is a great project.
Change History (7)
comment:1 by , 18 years ago
Description: | modified (diff) |
---|
comment:2 by , 18 years ago
Summary: | additional database api → Add DB API support for lookup against IP address fields |
---|
comment:3 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:4 by , 17 years ago
Keywords: | qs-rf added |
---|
comment:5 by , 17 years ago
Keywords: | qs-rf removed |
---|
Not a feature worth holding up queryset-refactor for. It can be done after the merge back into trunk. Removing the keyword.
comment:6 by , 14 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This is solved by adding the ability for custom (per-field) lookup types to the ORM syntax. Adding specific new lookup types is going to generally deferred until somebody implements that.
This is a nice idea (I'd think that overloading the "in" lookup type would work best) here, but I'm concerned that there's not a way to do this in a database-agnostic manner. Kirk, do you think you could do a quick survey of databases and see if it's going to be possible to do this generically?