Fixes: #17358 - Ensure correct comparison of overlapping IPRanges (#17391)

* Add new INET lookups for net_host_lt/gt/lte/gte comparisons irrespective of subnet inclusion

* Refactor Lookup subclasses to be more DRY

* Move comparison_sql to class attribute

* Add HostAsInet(Transform) to perform cast

* Remove unnecessary Lookup comparison classes

* Chain Host and Inet instead of making a new transform
This commit is contained in:
bctiemann
2024-10-28 15:07:59 -04:00
committed by GitHub
parent 476194f0aa
commit ca210168df
3 changed files with 38 additions and 7 deletions

View File

@@ -105,6 +105,8 @@ IPAddressField.register_lookup(lookups.NetIn)
IPAddressField.register_lookup(lookups.NetHostContained)
IPAddressField.register_lookup(lookups.NetFamily)
IPAddressField.register_lookup(lookups.NetMaskLength)
IPAddressField.register_lookup(lookups.Host)
IPAddressField.register_lookup(lookups.Inet)
class ASNField(models.BigIntegerField):