Conversation
|
Thanks for the patches - I'm working on 0.8 and will review in the next few On Thu, Nov 8, 2012 at 4:00 PM, Manuel Hermann notifications@github.comwrote:
|
Conflicts: mongoengine/document.py mongoengine/queryset.py setup.py tests/test_fields.py
|
Would you be interested in working with this inside a new repo? Eg mongoengine-extras |
|
Yes, good idea. I can begin with that next month. 2013/4/11 Ross Lawley notifications@github.com
Manuel Hermann PGP: B8E99399 |
|
Cool added a ticket for it in that repo :D |
Hello,
I added the following IP handling fields:
These fields are searchable and you can even search for IP fields that are part of specified networks. And search for networks that contain a specific IP address. This works for both, IPv4 and v6.
The trick I did: Networks are stored as mere dicts containing the net prefix and its lowest and highest IP address as either int (v4) or hex strings (v6). This allows to search whether an IP is in the range the network.
As user you are just confronted with IP objects (from IPy). The IP handling is done transparently.
IP fields are searchable with the standard lt, lte, gt, gte, ne and the in/nin operators. in/nin ist used to search for IPs that are/aren't contained within the given net.
IP network fields are searchable with lt, lte, gt, gte, ne and contains. contains is used to search for networks containing a given IP.
What do you think. Would this be a usable feature for you?
Greetings,
Manuel