Skip to content
This repository
branch: develop

Merge pull request #14 from ko1es/master

Russian localization added
latest commit 40601c5ce1
Stefan Foulis authored
Octocat-spinner-32 phonenumber_field Merge pull request #14 from ko1es/master April 02, 2013
Octocat-spinner-32 .gitignore added gitignore September 01, 2011
Octocat-spinner-32 LICENSE basics working August 31, 2011
Octocat-spinner-32 MANIFEST.in basics working August 31, 2011
Octocat-spinner-32 README.rst better example in README September 15, 2011
Octocat-spinner-32 setup.py basics working August 31, 2011
README.rst

django-phonenumber-field

A international phone number field for django that uses http://pypi.python.org/pypi/phonenumbers for validation .

Installation

pip install django-phonenumber-field

Basic usage

Use it like any regular model field:

from phonenumber_field.modelfields import PhoneNumberField
class MyModel(models.Model):
    name = models.CharField(max_length=255)
    phone_number = PhoneNumberField()
    fax_number = PhoneNumberField(null=True, blank=True)

PhoneNumberField will always represent the number as a string of an international phonenumber in the database. E.g +41524204242.

The object returned is not just a plain String. It is a PhoneNumber object. Currently it is necessary to always use the international format when entering data.

Future versions of django-phonenumber-field may provide custom special widgets that support more custom formatting.

Something went wrong with that request. Please try again.