Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#8664 closed (fixed)

PhoneNumberField should be moved to django.contrib.localflavor.us

Reported by: Piotr Lewandowski <django@…> Owned by: Jacob
Component: Database layer (models, ORM) Version: dev
Severity: Keywords: us localflavor
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Like russelm has mentioned in #8210 - PhoneNumberField should be moved to django.contrib.localflavor.us.

After closing this ticket and #8210 there would be no references to django.contrib.localflavor from Django code (excluding django/contrib/localflavor directory itself).

Attachments (3)

8664-1.diff (3.3 KB ) - added by gkelly 16 years ago.
Moves to django.contrib.localflavor.us.models. No additional changes.
8664-1.2.diff (3.3 KB ) - added by gkelly 16 years ago.
Same as above, but without the newline warning
8664-2.diff (5.9 KB ) - added by Matt McClanahan 16 years ago.
Add db_type method, backends.*.creation references, fix test error

Download all attachments as: .zip

Change History (16)

comment:1 by Piotr Lewandowski <django@…>, 16 years ago

Component: UncategorizedDatabase wrapper
Keywords: us localflavor added

comment:2 by Daniel Pope <dan@…>, 16 years ago

It might be appropriate to replace it with a base PhoneNumberField that accepts r'^[0-9+ #*().-]+$'

comment:3 by gkelly, 16 years ago

milestone: 1.0

#8210 has a 1.0 milestone, this should too.

comment:4 by gkelly, 16 years ago

Owner: changed from nobody to gkelly
Status: newassigned

by gkelly, 16 years ago

Attachment: 8664-1.diff added

Moves to django.contrib.localflavor.us.models. No additional changes.

by gkelly, 16 years ago

Attachment: 8664-1.2.diff added

Same as above, but without the newline warning

comment:5 by gkelly, 16 years ago

Component: Database wrapperdjango.contrib.localflavor
Has patch: set
Triage Stage: UnreviewedDesign decision needed

Patch adds a new file django.contrib.localflavor.us.fields, which is also (maybe already) added by #8210.

in reply to:  5 comment:6 by gkelly, 16 years ago

Replying to gkelly:

Patch adds a new file django.contrib.localflavor.us.fields, which is also (maybe already) added by #8210.

Should be django.contrib.localflavor.us.models rather.

comment:7 by gkelly, 16 years ago

Patch needs improvement: set

Something wrong with the patch, no time to debug right now:

./runtests.py --settings=settings model_forms

Error while importing model_forms:  File "./runtests.py", line 130, in django_tests
    mod = load_app(model_label)
  File "/sw/lib/python2.5/site-packages/django/db/models/loading.py", line 72, in load_app
    mod = __import__(app_name, {}, {}, ['models'])
  File "/usr/local/src/django/trunk/tests/modeltests/model_forms/models.py", line 72, in <module>
    class PhoneNumber(models.Model):
  File "/sw/lib/python2.5/site-packages/django/db/models/base.py", line 84, in __new__
    new_class.add_to_class(obj_name, obj)
  File "/sw/lib/python2.5/site-packages/django/db/models/base.py", line 135, in add_to_class
    value.contribute_to_class(cls, name)
TypeError: Error when calling the metaclass bases
    unbound method contribute_to_class() must be called with PhoneNumberField instance as first argument (got ModelBase instance instead)
Traceback (most recent call last):
  File "./runtests.py", line 183, in <module>
    django_tests(int(options.verbosity), options.interactive, args)
  File "./runtests.py", line 153, in django_tests
    failures = run_tests(test_labels, verbosity=verbosity, interactive=interactive, extra_tests=extra_tests)
  File "/sw/lib/python2.5/site-packages/django/test/simple.py", line 131, in run_tests
    app = get_app(label)
  File "/sw/lib/python2.5/site-packages/django/db/models/loading.py", line 122, in get_app
    raise ImproperlyConfigured, "App with label %s could not be found" % app_label
django.core.exceptions.ImproperlyConfigured: App with label model_forms could not be found

comment:8 by Eric Holscher, 16 years ago

Component: django.contrib.localflavorDatabase wrapper
Triage Stage: Design decision neededAccepted

Assuming this is accepted because it's basically the same as #8210

by Matt McClanahan, 16 years ago

Attachment: 8664-2.diff added

Add db_type method, backends.*.creation references, fix test error

comment:9 by Matt McClanahan, 16 years ago

Patch needs improvement: unset

comment:10 by Jacob, 16 years ago

Owner: changed from gkelly to Jacob
Status: assignednew

comment:11 by Jacob, 16 years ago

Status: newassigned

comment:12 by Jacob, 16 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [8819].

comment:13 by Jacob, 12 years ago

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top