Metadata-Version: 1.1
Name: django-cidrfield
Version: 0.1.2
Summary: Proper CIDR fields for Django running on any database
Home-page: https://github.com/Werneror/django-cidrfield
Author: Werner
Author-email: me@werner.wiki
License: MIT
Description: .. -*- restructuredtext -*-
        
        django-cidrfield
        ================
        
        ``cidrfield`` provides a model field for 
        `django <https://www.djangoproject.com>`_
        that allows the storage of an ip network on the db side by using ``ipaddress`` 
        to handle conversion to an ``ipaddress.ip_network`` instance (or ``None``) 
        on the python side. It supports the use of ``__contains`` and ``__in`` 
        to query the IP network that contain and belong to.
        
        
        
        Installation
        ------------
        
        Add this to your django project by installing with ``pip``: ::
            
            pip install django-cidrfield
        
        
        
        Usage
        -----
        
        In your models, do something like the following: ::
            
        	from django.db import models
        	from cidrfield.models import IPNetworkField
        
        	class MyModel(models.Model):
        
        	    # the regular params should work well enough here
        	    ip_network = IPNetworkField()
        	    # ... and so on
        
        
        Then you can store a ip network like the following::
            
            
        	MyModel(ip_network='192.168.1.0/24').save()
        
        
        Then you can store a ip network like the following::
            
            
        	MyModel.objects.filter(ip_network__contains='192.168.1.1')
        	MyModel.objects.filter(ip_network__in='192.168.0.0/16')
        
        
Keywords: ip,cidr,models,django
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
