skip to navigation
skip to content

Not Logged In

django-phonenumber-field 0.2a3

An international phone number field for django models.

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.

 
File Type Py Version Uploaded on Size
django-phonenumber-field-0.2a3.tar.gz (md5) Source 2012-05-02 6KB
  • Downloads (All Versions):
  • 104 downloads in the last day
  • 699 downloads in the last week
  • 2969 downloads in the last month