diff --git a/django/contrib/localflavor/us/models.py b/django/contrib/localflavor/us/models.py
index 4cb6e68..1488fe8 100644
a
|
b
|
|
1 | 1 | from django.conf import settings |
2 | 2 | from django.utils.translation import ugettext_lazy as _ |
3 | | from django.db.models.fields import Field, CharField |
| 3 | from django.db.models.fields import CharField |
4 | 4 | from django.contrib.localflavor.us.us_states import STATE_CHOICES |
5 | 5 | |
6 | 6 | class USStateField(CharField): |
… |
… |
class USStateField(CharField):
|
12 | 12 | kwargs['max_length'] = 2 |
13 | 13 | super(USStateField, self).__init__(*args, **kwargs) |
14 | 14 | |
15 | | class PhoneNumberField(Field): |
| 15 | class PhoneNumberField(CharField): |
16 | 16 | |
17 | 17 | description = _("Phone number") |
18 | | |
19 | | def get_internal_type(self): |
20 | | return "PhoneNumberField" |
21 | | |
22 | | def db_type(self, connection): |
23 | | if connection.settings_dict['ENGINE'] == 'django.db.backends.oracle': |
24 | | return 'VARCHAR2(20)' |
25 | | else: |
26 | | return 'varchar(20)' |
| 18 | |
| 19 | def __init__(self, *args, **kwargs): |
| 20 | kwargs['max_length'] = 20 |
| 21 | super(PhoneNumberField, self).__init__(*args, **kwargs) |
27 | 22 | |
28 | 23 | def formfield(self, **kwargs): |
29 | 24 | from django.contrib.localflavor.us.forms import USPhoneNumberField |