Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Country-specific Django helpers for Canada.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 django_localflavor_ca
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rst
Octocat-spinner-32 run_tests.py
Octocat-spinner-32 setup.py
README.rst

django_localflavor_ca

Country-specific Django helpers for Canada.

WARNING

This app has been superseded by the newly created django-localflavor app which recombines all the different country locaflavors again (after having been removed from Django). Development and maintenance of this app has stopped and is only left online as a reminder for the users of those apps. It will be removed after grace period of 1 Django release (~spring 2014).

What's in the Canada localflavor?

  • forms.CAPhoneNumberField: A form field that validates input as a Canadian phone number, with the format XXX-XXX-XXXX.
  • forms.CAPostalCodeField: A form field that validates input as a Canadian postal code, with the format XXX XXX.
  • forms.CAProvinceField: A form field that validates input as a Canadian province name or abbreviation.
  • forms.CASocialInsuranceNumberField: A form field that validates input as a Canadian Social Insurance Number (SIN). A valid number must have the format XXX-XXX-XXX and pass a Luhn mod-10 checksum.
  • forms.CAProvinceSelect: A Select widget that uses a list of Canadian provinces and territories as its choices.

See the source code for full details.

About localflavors

Django's "localflavor" packages offer additional functionality for particular countries or cultures.

For example, these might include form fields for your country's postal codes, phone number formats or government ID numbers.

This code used to live in Django proper -- in django.contrib.localflavor -- but was separated into standalone packages in Django 1.5 to keep the framework's core clean.

For a full list of available localflavors, see https://github.com/django/

Something went wrong with that request. Please try again.