{ "info": { "author": "James Oakley", "author_email": "jfunk@funktronics.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Utilities" ], "description": "Django PostgreSQL Netfields\n===========================\n\n.. image:: https://secure.travis-ci.org/jimfunk/django-postgresql-netfields.png\n\nThis project is an attempt at making proper PostgreSQL net related fields for\nDjango. In Django pre 1.4 the built in ``IPAddressField`` does not support IPv6\nand uses an inefficient ``HOST()`` cast in all lookups. As of 1.4 you can use\n``GenericIPAddressField`` for IPv6, but the casting problem remains.\n\nIn addition to the basic ``IPAddressField`` replacement a ``CIDR`` and\na ``MACADDR`` field have been added. This library also provides a manager that\nallows for advanced IP based lookup directly in the ORM.\n\nIn Python, the values of the IP address fields are represented as types from\nthe ipaddress_ module. In Python 2.x, a backport_ is used. The MAC address\nfield is represented as an EUI type from the netaddr_ module.\n\n.. _ipaddress: https://docs.python.org/3/library/ipaddress.html\n.. _backport: https://pypi.python.org/pypi/ipaddress/\n.. _netaddr: http://pythonhosted.org/netaddr/\n\nDependencies\n------------\n\nCurrent version of code is targeting Django >= 1.8 support, as this relies\nheavily on ORM internals and supporting multiple versions is especially tricky.\n\nGetting started\n---------------\n\nMake sure ``netfields`` is in your ``PYTHONPATH`` and in ``INSTALLED_APPS``.\n\n``InetAddressField`` will store values in PostgreSQL as type ``INET``. In\nPython, the value will be represented as an ``ipaddress.ip_interface`` object\nrepresenting an IP address and netmask/prefix length pair unless the\n``store_prefix_length`` argument is set to `False``, in which case the value\nwill be represented as an ``ipaddress.ip_address`` object.\n\n.. code-block:: python\n\n from netfields import InetAddressField, NetManager\n\n class Example(models.Model):\n inet = InetAddressField()\n # ...\n\n objects = NetManager()\n\n``CidrAddressField`` will store values in PostgreSQL as type ``CIDR``. In\nPython, the value will be represented as an ``ipaddress.ip_network`` object.\n\n.. code-block:: python\n\n from netfields import CidrAddressField, NetManager\n\n class Example(models.Model):\n inet = CidrAddressField()\n # ...\n\n objects = NetManager()\n\n``MACAddressField`` will store values in PostgreSQL as type ``MACADDR``. In\nPython, the value will be represented as a ``netaddr.EUI`` object. Note that\nthe default text representation of EUI objects is not the same as that of the\n``netaddr`` module. It is represented in a format that is more commonly used\nin network utilities and by network administrators (``00:11:22:aa:bb:cc``).\n\n.. code-block:: python\n\n from netfields import MACAddressField, NetManager\n\n class Example(models.Model):\n inet = MACAddressField()\n # ...\n\nFor ``InetAddressField`` and ``CidrAddressField``, ``NetManager`` is required\nfor the extra lookups to be available. Lookups for ``INET`` and ``CIDR``\ndatabase types will be handled differently than when running vanilla Django.\nAll lookups are case-insensitive and text based lookups are avoided whenever\npossible. In addition to Django's default lookup types the following have been\nadded:\n\n``__net_contained``\n is contained within the given network\n\n``__net_contained_or_equal``\n is contained within or equal to the given network\n\n``__net_contains``\n contains the given address\n\n``__net_contains_or_equals``\n contains or is equal to the given address/network\n\n``__net_overlaps``\n contains or contained by the given address\n\n``__family``\n matches the given address family\n\n``__host``\n matches the host part of an address regardless of prefix length\n\nThese correspond with the operators and functions from\nhttp://www.postgresql.org/docs/9.4/interactive/functions-net.html\n\n``CidrAddressField`` includes two extra lookups:\n\n``__max_prefixlen``\n Maximum value (inclusive) for ``CIDR`` prefix, does not distinguish between IPv4 and IPv6\n\n``__min_prefixlen``\n Minimum value (inclusive) for ``CIDR`` prefix, does not distinguish between IPv4 and IPv6\n\nAs of Django 2.2, indexes can be created for ``InetAddressField`` and ``CidrAddressField`` extra lookups directly on the model.\n\n.. code-block:: python\n\n from django.contrib.postgres.indexes import GistIndex\n from netfields import CidrAddressField, NetManager\n\n class Example(models.Model):\n inet = CidrAddressField()\n # ...\n\n class Meta:\n indexes = (\n GistIndex(\n fields=('inet',), opclasses=('inet_ops',),\n name='app_example_inet_idx'\n ),\n )\n\nFor earlier versions of Django, a custom migration can be used to install an index.\n\n.. code-block:: python\n\n from django.db import migrations\n\n class Migration(migrations.Migration):\n # ...\n\n operations = [\n # ...\n migrations.RunSQL(\n \"CREATE INDEX app_example_inet_idx ON app_example USING GIST (inet inet_ops);\"\n ),\n # ...\n ]\n\nErrata\n------\n\n* In Django < 1.9.6 types returned in ArrayFields are strings and not ipaddress types. See\n https://code.djangoproject.com/ticket/25143\n\nRelated Django bugs\n-------------------\n\n* 11442_ - Postgresql backend casts inet types to text, breaks IP operations and IPv6 lookups.\n* 811_ - IPv6 address field support.\n\nhttps://docs.djangoproject.com/en/dev/releases/1.4/#extended-ipv6-support is also relevant\n\n.. _11442: http://code.djangoproject.com/ticket/11442\n.. _811: http://code.djangoproject.com/ticket/811\n\n\nSimilar projects\n----------------\n\nhttps://bitbucket.org/onelson/django-ipyfield tries to solve some of the same\nissues as this library. However, instead of supporting just postgres via the proper\nfields types the ipyfield currently uses a ``VARCHAR(39)`` as a fake unsigned 64 bit\nnumber in its implementation.\n\nHistory\n-------\n\nMain repo was originally kept https://github.com/adamcik/django-postgresql-netfields\nLate April 2013 the project was moved to https://github.com/jimfunk/django-postgresql-netfields\nto pass the torch on to someone who actually uses this code actively :-)\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jimfunk/django-postgresql-netfields", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-netfields", "package_url": "https://pypi.org/project/django-netfields/", "platform": "", "project_url": "https://pypi.org/project/django-netfields/", "project_urls": { "Homepage": "https://github.com/jimfunk/django-postgresql-netfields" }, "release_url": "https://pypi.org/project/django-netfields/1.1.1/", "requires_dist": null, "requires_python": "", "summary": "Django PostgreSQL netfields implementation", "version": "1.1.1" }, "last_serial": 5909086, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "fdf9a02c725acaee9c9a17e24c518857", "sha256": "f4250de86f4022c829d8801cb11a761d511a18d1ca7402b6a8d03f397726a8ac" }, "downloads": -1, "filename": "django-netfields-0.1.tar.gz", "has_sig": false, "md5_digest": "fdf9a02c725acaee9c9a17e24c518857", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5880, "upload_time": "2012-10-07T13:38:32", "url": "https://files.pythonhosted.org/packages/4e/43/366c2753ba78639de9be896b9f744143e3bfeeabd8f9097a74b8b9936cd7/django-netfields-0.1.tar.gz" } ], "0.10.0": [ { "comment_text": "", "digests": { "md5": "94013f8ec50556f106dc9108d26861b0", "sha256": "9adf37d5f1c8cfba7bbb3310fa3319f14a1c57e00ddb41f0d0d0302c14b3cc41" }, "downloads": -1, "filename": "django-netfields-0.10.0.tar.gz", "has_sig": false, "md5_digest": "94013f8ec50556f106dc9108d26861b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15416, "upload_time": "2019-02-22T16:37:11", "url": "https://files.pythonhosted.org/packages/60/5b/3b79c7b87a558b7203765d32cb332adb744b9dd35cecbad816ae23856679/django-netfields-0.10.0.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "34e9fa8d25a83ddc19748db48d4297b7", "sha256": "8c3e017299fc8026ef48604441ae41c7163d86ed20ea0070e84d71f98695b11e" }, "downloads": -1, "filename": "django-netfields-0.2.tar.gz", "has_sig": false, "md5_digest": "34e9fa8d25a83ddc19748db48d4297b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10826, "upload_time": "2013-05-02T01:02:08", "url": "https://files.pythonhosted.org/packages/85/45/28bf63532606d0301240b9f52d1248491e9111fdccf709d6642bfce7165d/django-netfields-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "26e0fe72ded81ba85425eb0aa92c077b", "sha256": "2061ebdbecfa51a0bf46f4f962fa28d7ee8890783028951d96f2c158844fc8e1" }, "downloads": -1, "filename": "django-netfields-0.2.1.tar.gz", "has_sig": false, "md5_digest": "26e0fe72ded81ba85425eb0aa92c077b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10887, "upload_time": "2013-05-03T18:37:41", "url": "https://files.pythonhosted.org/packages/d5/db/76cd70ac81b6c4fd784881dfa4d65181d1d0a120fcca47599ece3603fc18/django-netfields-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "a7390ce85e3399ffdabfbea291c11641", "sha256": "808cbca5f5ce73cd2bd8d763fdf08485d042ae39a53afd105684fd067cf7820d" }, "downloads": -1, "filename": "django-netfields-0.2.2.tar.gz", "has_sig": false, "md5_digest": "a7390ce85e3399ffdabfbea291c11641", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9754, "upload_time": "2014-07-08T01:57:43", "url": "https://files.pythonhosted.org/packages/e0/c3/0e56155e4ff76e811faa24c2df00f49206824a70833b4163f6ac058ff6af/django-netfields-0.2.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "a5b636ad8a7840c86f87b873f16b3c4f", "sha256": "c8df45f7133b500dc58c6c647c4399f21b7d60cb042d92da09706d5357f4fee4" }, "downloads": -1, "filename": "django-netfields-0.3.tar.gz", "has_sig": false, "md5_digest": "a5b636ad8a7840c86f87b873f16b3c4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11092, "upload_time": "2015-04-17T03:27:13", "url": "https://files.pythonhosted.org/packages/bc/86/df596620952efed10c57a48aee8136673534e78c8eba9abe5656e0112711/django-netfields-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "0ec3a7a807c12112ae9499a298a3c2d3", "sha256": "a9bea1b7e6ba56e45fd6fd2f8f39c3824b38a85f506b517053dbecea33e38d99" }, "downloads": -1, "filename": "django-netfields-0.3.1.tar.gz", "has_sig": false, "md5_digest": "0ec3a7a807c12112ae9499a298a3c2d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11665, "upload_time": "2015-07-05T17:40:41", "url": "https://files.pythonhosted.org/packages/14/cf/7e1ce4b5aabb38e1c06e718ac0e3cb0d6675b8cc9be36b575025f773d069/django-netfields-0.3.1.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "ad22035bc1a61200700eb009e07918c4", "sha256": "e4ae9717359f6ad1a8cbe6bb1a867b9d83c2f8e9e527dc9de935e7a566a7051a" }, "downloads": -1, "filename": "django-netfields-0.4.tar.gz", "has_sig": false, "md5_digest": "ad22035bc1a61200700eb009e07918c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11864, "upload_time": "2015-10-21T06:46:15", "url": "https://files.pythonhosted.org/packages/3e/fd/77a2e51a27d783b8b4ce3baf57d23d513cc5371292b33eacc10efd97ab1a/django-netfields-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "18eed570667aee9efb748b22d31d46af", "sha256": "73fd1e272b9f97229f97d7611307ed843cd4f409bb787194c0e54405600696bf" }, "downloads": -1, "filename": "django-netfields-0.4.1.tar.gz", "has_sig": false, "md5_digest": "18eed570667aee9efb748b22d31d46af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12969, "upload_time": "2015-10-22T03:21:26", "url": "https://files.pythonhosted.org/packages/2f/fd/82b33c4b8be2c6d9e1291a10b478b453ce442ae2b9c08db7388f19c61f5d/django-netfields-0.4.1.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "ff73f035731ea59ce4a869ba2231b4fb", "sha256": "ea9a5ed08ac11d0d788d85867abe1620a5ec87b8aab140df7bf881827b87ef8a" }, "downloads": -1, "filename": "django-netfields-0.5.tar.gz", "has_sig": false, "md5_digest": "ff73f035731ea59ce4a869ba2231b4fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12359, "upload_time": "2015-10-22T16:59:55", "url": "https://files.pythonhosted.org/packages/a3/01/0ed9343970c83bbbb1385843c767dba19a2fb8e32f262c454dc44f61280c/django-netfields-0.5.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "bf97e0319f9fa6a622852810777e01fb", "sha256": "c4cf99e735b225e3f9eda615815baa5170c61636cd217eefaaf40ba0092df4f5" }, "downloads": -1, "filename": "django-netfields-0.5.1.tar.gz", "has_sig": false, "md5_digest": "bf97e0319f9fa6a622852810777e01fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12506, "upload_time": "2015-10-25T19:16:25", "url": "https://files.pythonhosted.org/packages/b8/b1/ceaba7255669480f878ab723038a4ecef9da8480c0b538ffcd2c03fac1da/django-netfields-0.5.1.tar.gz" } ], "0.5.2": [ { "comment_text": "", "digests": { "md5": "ad26a92dbd15a95677d26d46e61edfb4", "sha256": "059a03b63a34566f58eba684696f896441b852960534a7c72cf9e94587939578" }, "downloads": -1, "filename": "django-netfields-0.5.2.tar.gz", "has_sig": false, "md5_digest": "ad26a92dbd15a95677d26d46e61edfb4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12805, "upload_time": "2015-12-03T04:45:57", "url": "https://files.pythonhosted.org/packages/b2/c1/3e2a5d74c1d7427f9413fcdaf86b9795c5e21b75034b25962a8bc5bce29e/django-netfields-0.5.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "d85aa05e037be78e3a2b3599c97fc0e2", "sha256": "e31bf5a963bb918a39898ff6b9c0f02901677bc81283c7c16aa1623bff9e752f" }, "downloads": -1, "filename": "django-netfields-0.5.3.tar.gz", "has_sig": false, "md5_digest": "d85aa05e037be78e3a2b3599c97fc0e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13406, "upload_time": "2016-02-17T07:18:36", "url": "https://files.pythonhosted.org/packages/30/0d/07f47e0fc170021154a1946ce0510822b8cc65ed40a1fb0ff0b1415b92d5/django-netfields-0.5.3.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "7c05b72252e932cbdfdf11c434e17256", "sha256": "3ef06875ffcbedaa08a60d5fe334b7c1aa9d22de2cecd919ff5e8350e07d1d93" }, "downloads": -1, "filename": "django-netfields-0.7.tar.gz", "has_sig": false, "md5_digest": "7c05b72252e932cbdfdf11c434e17256", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14587, "upload_time": "2016-08-19T17:51:52", "url": "https://files.pythonhosted.org/packages/5f/25/3c27b6751bbe40496aa8d5a9de2db1cc47634ffe69a687965f09c36fd6ce/django-netfields-0.7.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "b9736a3c677f90d16f4a85ccc60d3530", "sha256": "e56272f03f682eacd75602c292ee7acb241bbe9ea09de9f47905f54b2f4c483e" }, "downloads": -1, "filename": "django-netfields-0.7.1.tar.gz", "has_sig": false, "md5_digest": "b9736a3c677f90d16f4a85ccc60d3530", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17254, "upload_time": "2017-03-14T12:55:12", "url": "https://files.pythonhosted.org/packages/eb/8b/847d849dc896c9b12289266f8ccda6b937a6d41da4724149bea27028235a/django-netfields-0.7.1.tar.gz" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "d6f4f82e865009d8b173f44271d3ff25", "sha256": "0d210de259a986453b1e299bc512578a7fe18b0753388d75fa636c7588e0d151" }, "downloads": -1, "filename": "django-netfields-0.7.2.tar.gz", "has_sig": false, "md5_digest": "d6f4f82e865009d8b173f44271d3ff25", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17678, "upload_time": "2017-03-26T00:31:53", "url": "https://files.pythonhosted.org/packages/43/ed/e15be1c246f5e91b0868cb44b0e8da57ba35aaea3744ffdbaea8bf5a03a5/django-netfields-0.7.2.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "da82a6b51b278bb25ebb05d21adb84ff", "sha256": "5c8d4840652799e290849590c013a112da069f47e89e1064ed18671cac26268c" }, "downloads": -1, "filename": "django-netfields-0.8.tar.gz", "has_sig": false, "md5_digest": "da82a6b51b278bb25ebb05d21adb84ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14745, "upload_time": "2017-12-07T02:29:07", "url": "https://files.pythonhosted.org/packages/83/31/249973d57131ff60cb8ef5d2202161c08004a7924f8b831f5659fe2fe6f2/django-netfields-0.8.tar.gz" } ], "0.9.0": [ { "comment_text": "", "digests": { "md5": "c85b0c6bc443972cfbcdc6c8dcf9c0ef", "sha256": "e01024b9524352b6fce98c5c02dc92572974a752bde49aecf450ff43b3271a89" }, "downloads": -1, "filename": "django-netfields-0.9.0.tar.gz", "has_sig": false, "md5_digest": "c85b0c6bc443972cfbcdc6c8dcf9c0ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15176, "upload_time": "2018-10-08T16:49:22", "url": "https://files.pythonhosted.org/packages/2c/21/94e23be89b54d2ebc6f7a56baf874528720799f0152c8b56ec67e4888dd2/django-netfields-0.9.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "912ebcac3b72ecb9d17b97e2419981d1", "sha256": "f9a5c0d514e8ef246535c6d787eeedf4162a1e053d04712d413a23f4f30aac34" }, "downloads": -1, "filename": "django-netfields-1.0.0.tar.gz", "has_sig": false, "md5_digest": "912ebcac3b72ecb9d17b97e2419981d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15628, "upload_time": "2019-06-06T16:26:28", "url": "https://files.pythonhosted.org/packages/90/c9/64f29d7928cae3a0a8662071eff3a0bf3c74209d30679ea1e0d23d6390de/django-netfields-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "06a13da5b27d4dfe55fb3ca24a32ee54", "sha256": "9a15c6c421dd6604c65dd99f73078067610dc26ef9766adf15d49dba957f3f88" }, "downloads": -1, "filename": "django-netfields-1.0.1.tar.gz", "has_sig": false, "md5_digest": "06a13da5b27d4dfe55fb3ca24a32ee54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15739, "upload_time": "2019-06-07T15:38:18", "url": "https://files.pythonhosted.org/packages/e3/ea/4e90cd4fc0c2c3519ccbca5dbc381939225481e66b5af563918341d40bdd/django-netfields-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "2f656fb2dabe113182de5b278eb75bca", "sha256": "cc5ae2a12b97b85f309106484f69b06a236dd6cd1e16b7b390a09091313500cc" }, "downloads": -1, "filename": "django-netfields-1.1.0.tar.gz", "has_sig": false, "md5_digest": "2f656fb2dabe113182de5b278eb75bca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16076, "upload_time": "2019-09-10T13:55:10", "url": "https://files.pythonhosted.org/packages/dd/5c/6f6028faacc62191d92e0bba8b6ba262ffa8454aad935fe197ba053540ca/django-netfields-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "e5ed2cdc5b4b994dc6e7c4a9401f69f4", "sha256": "7c85c30e7eb207923827965b15ec13a19ab6a1db76c56cd0303cb555b2e3825e" }, "downloads": -1, "filename": "django-netfields-1.1.1.tar.gz", "has_sig": false, "md5_digest": "e5ed2cdc5b4b994dc6e7c4a9401f69f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16467, "upload_time": "2019-09-30T21:18:46", "url": "https://files.pythonhosted.org/packages/e0/b3/1525cde00a1c18adfe8e19ec3c6ee5fbfc14859a50ee6d68450fd017082c/django-netfields-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e5ed2cdc5b4b994dc6e7c4a9401f69f4", "sha256": "7c85c30e7eb207923827965b15ec13a19ab6a1db76c56cd0303cb555b2e3825e" }, "downloads": -1, "filename": "django-netfields-1.1.1.tar.gz", "has_sig": false, "md5_digest": "e5ed2cdc5b4b994dc6e7c4a9401f69f4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16467, "upload_time": "2019-09-30T21:18:46", "url": "https://files.pythonhosted.org/packages/e0/b3/1525cde00a1c18adfe8e19ec3c6ee5fbfc14859a50ee6d68450fd017082c/django-netfields-1.1.1.tar.gz" } ] }