Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    django-postal 0.93

    Download button

    No screenshots available
    Downloads: 418  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Michael Thornhill | More programs
    BSD License / FREE
    September 13th, 2012, 02:11 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-postal description

    A Django app for l10n of postal addresses

    django-postal is a Django application that provides a location agnostic model for postal addresses.

    The motivation behind this project is that most countries have different forms of postal addresses e.g. http://www.bitboost.com/ref/international-address-formats.html, http://en.wikipedia.org/wiki/Address_(geography)

    This app assumes that all postal addresses worldwide can be made up of 5 optional address lines plus a country code.

    It then localizes the title of each line dependant on the country selected. Further information on each address line can be gleaned from django.contrib.localflavor fields and widgets e.g. for the UK

    from django import forms
    from django.utils.translation import ugettext_lazy as _
    from django.contrib.localflavor.uk.forms import UKPostcodeField, UKCountySelect

    from postal.forms import PostalAddressForm


    class GBPostalAddressForm(PostalAddressForm):
        line1 = forms.CharField(label=_(u"Company name"), required=False, max_length=50)
        line2 = forms.CharField(label=_(u"Street"), max_length=50)
        city = forms.CharField(label=_(u"Town"), max_length=50)
        state = forms.CharField(label=_(u"County"), widget=UKCountySelect, max_length=50)
        code = UKPostcodeField(label=_(u"Postcode"))


    It is hoped that various contributors will contribute address formats per country and that eventually this address information could find it's way back in to django.contrib.localflavor

    Developers, How to Contribute:

    $ git clone git@github.com:mthornhill/django-postal.git
    $ cd django-postal
    $ virtualenv . --no-site-packages
    $ source bin/activate
    $ python bootstrap.py
    $ bin/buildout -v
    $ bin/django syncdb
    $ bin/test
    $ bin/django runserver


    browse to http://localhost:8000

    new countries can be added to the src/postal folder by their 2 letter country code e.g. us

    Each country folder contains an __init__.py and a forms.py forms.py contains the localized address

    Usage:

    1. Add django-countries and django-postal to your INSTALLED_APPS in settings.py
    e.g.

    INSTALLED_APPS = (
        "countries",
        "postal",
        ...
        )


    2. In your view code import the code for getting a localized postal address

    views.py
    from postal.views import get_postal_form_class


    form_class = get_postal_form_class("us")
    postal_form = form_class()


    3. Add postal_form to your templates

    some_template.html
    {{postal_form}}


    4. In this case we will have a US postal form


    Product's homepage

    Requirements:

    · Python
    · Django
    · django-countries

      


    TAGS:

    postal addresses | Django plugin | l10n | postal | address

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM