I have:
class Range(models.Model):
ip = models.IntegerField() # as produced by socket.inet_aton + struct.unpack
mask = models.IntegerField()
Given a certain IP, how can I get all the ranges that match this specific IP using the Django models?
If I were using raw SQL, I would use the database's bitwise operators, but the Django ORM doesn't support those.