Metadata-Version: 1.1
Name: crdist
Version: 0.1
Summary: Costa Rican Geografic distribution for model admin in Django.
Home-page: https://github.com/solvo/crdist
Author: Luis Zarate Montero
Author-email: luis.zarate@solvosoft.com
License: GNU General Public License
Description: crdist
        =========
        Costa Rican Geografic distribution for model admin in Django
        
        .. note:: 
            The data is in Spanish.
            
            All source code is in English and of course it is spanish translated.
        
        Installation
        -------------
        
        Install crdist in your python environment
        
        1- Download and install package:
        
        .. code:: bash
        
            $ pip install crdist
        
        Through Github:
        
        .. code:: bash
        
            $ pip install git+https://github.com/solvo/crdist.git
        
        
        Put crdist in your INSTALLED_APPS
        
        .. code:: python
        
            INSTALLED_APPS = (
                ...
                'crdist',
                )
        
        Run migration 
        
        .. code:: bash
        
            $ python manage.py migrate    
        
        
        Usage
        ---------
        
        In your models create a Foreign relation to District in your *models.py* file.
        
        .. code:: python
            
            from crdist.models import District
            class Test(models.Model):
                name = models.CharField(max_length=64)
                location = models.ForeignKey(District) 
            
        
        We provide a form widget specially for choose Province, Canton and District in the same widget. eg.
        
        .. code:: python
        
            from crdist.widgets import DistrictSelect
            from crdist.models import District
            
            class CRForm(forms.Form):
                district = forms.ModelChoiceField(queryset=District.objects.all(),
                                              widget=DistrictSelect)
        
        
        It's also ok use with admin interface, you can add some code in your *admin.py* file.
        
        .. code:: python
        
            class TestAdminForm(forms.ModelForm):
                class Meta:
                    model = Test
                    fields = '__all__'
                    widgets = {
                      'district': DistrictSelect(attrs={"class": "form-control"}),
                    }
            
            
            class TestAdmin(admin.ModelAdmin):
                form = TestAdminForm
        
            admin.site.register(Test, TestAdmin)
            
        We also support multiple relations in the same model, so you can display several widgets in the same page.
        
Platform: OS Independent
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
