This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Address fields autofill app for forms using brazilian CEP field.

Project Description

django-cep

This application enables Django powered websites to have autofilled address fields in forms based on brazilian CEP field.

Installation

To install django-cep simply run:

pip install django-cep

Configuration

We need to hook django-cep into our project.

Put cep into your INSTALLED_APPS at settings module:

INSTALLED_APPS = (
   ...
   'cep',
)

Bind the cep urls.py into your main urls.py with something like:

url(r'^cep/', include('cep.urls')),

Usage

Currently the only syntax supported is setting the IDs of the address fields in the widget of the CEP field. For other ways to set this up, see the NEXT-STEPS file.

  1. Import the django-cep widget CEPInput in your forms.py:

    from cep.widgets import CEPInput
    
  2. Set your CEP field for using the CEPInput, with the correct address fields ID, for example:

    my_cep_field = ChangeToMyCEPFieldModelName(label=u"CEP",
                            help_text="Format: XXXXX-XXX",
                            widget=CEPInput(address={
                                                     'street': 'id_street_field',
                                                     'district': 'id_district_field',
                                                     'city': 'id_city_field',
                                                     'state': 'id_state_field'
                                                     }))
    
That stands for a street field ID equals id_street_field, district field ID equals id_district_field, city field ID equals id_city_field and a state field ID equals id_state_field.

Also note that the JavaScript used in this app requires JQuery to run properly.

It is highly recommended that you use Django Localflavor’s BRStateChoiceField for the State field, to make it render the correct brazilian state from the list.

Release History

Release History

This version
History Node

1.1.2

History Node

1.1.1

History Node

1.1.0

History Node

1.0.9

History Node

1.0.8

History Node

1.0.7

History Node

1.0.6-2

History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-cep-1.1.2.tar.gz (5.3 kB) Copy SHA256 Checksum SHA256 Source May 20, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting