Django

Code

Ticket #8664 (closed: fixed)

Opened 3 months ago

Last modified 3 months ago

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

Reported by: Piotr Lewandowski <django@icomputing.pl> Assigned to: jacob
Milestone: 1.0 Component: Database layer (models, ORM)
Version: SVN Keywords: us localflavor
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

8664-1.diff (3.3 kB) - added by gkelly on 08/30/08 00:30:32.
Moves to django.contrib.localflavor.us.models. No additional changes.
8664-1.2.diff (3.3 kB) - added by gkelly on 08/30/08 00:34:07.
Same as above, but without the newline warning
8664-2.diff (5.9 kB) - added by mattmcc on 08/31/08 19:55:40.
Add db_type method, backends.*.creation references, fix test error

Change History

08/28/08 20:17:17 changed by Piotr Lewandowski <django@icomputing.pl>

  • keywords set to us localflavor.
  • needs_better_patch changed.
  • component changed from Uncategorized to Database wrapper.
  • needs_tests changed.
  • needs_docs changed.

08/29/08 07:39:11 changed by Daniel Pope <dan@mauveinternet.co.uk>

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

08/29/08 22:11:32 changed by gkelly

  • milestone set to 1.0.

#8210 has a 1.0 milestone, this should too.

08/29/08 23:02:26 changed by gkelly

  • owner changed from nobody to gkelly.
  • status changed from new to assigned.

08/30/08 00:30:32 changed by gkelly

  • attachment 8664-1.diff added.

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

08/30/08 00:34:07 changed by gkelly

  • attachment 8664-1.2.diff added.

Same as above, but without the newline warning

(follow-up: ↓ 6 ) 08/30/08 00:37:56 changed by gkelly

  • has_patch set to 1.
  • component changed from Database wrapper to django.contrib.localflavor.
  • stage changed from Unreviewed to Design decision needed.

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

(in reply to: ↑ 5 ) 08/30/08 00:39:24 changed by gkelly

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.

08/30/08 11:07:08 changed by gkelly

  • needs_better_patch set to 1.

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

08/31/08 15:59:59 changed by ericholscher

  • component changed from django.contrib.localflavor to Database wrapper.
  • stage changed from Design decision needed to Accepted.

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

08/31/08 19:55:40 changed by mattmcc

  • attachment 8664-2.diff added.

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

08/31/08 19:56:04 changed by mattmcc

  • needs_better_patch deleted.

09/01/08 17:03:16 changed by jacob

  • owner changed from gkelly to jacob.
  • status changed from assigned to new.

09/01/08 17:03:23 changed by jacob

  • status changed from new to assigned.

09/01/08 17:16:36 changed by jacob

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in [8819].


Add/Change #8664 (PhoneNumberField should be moved to django.contrib.localflavor.us)




Change Properties
Action