Opened 7 years ago

Closed 6 years ago

Last modified 3 years ago

#8210 closed Uncategorized (fixed)

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

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

Description

USStateField is currently in django.db.models.fields. Pre-1.0 stage is the last chance to move it to a proper place, i.e. to django.contrib.localflavor.us.

Attachments (2)

8210-1.diff (6.0 KB) - added by mattmcc 7 years ago.
8210-2.diff (8.2 KB) - added by mattmcc 6 years ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 7 years ago by julianb

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 years ago by Jakub Wilk <ubanus@…>

  • Cc ubanus@… added

comment:3 Changed 7 years ago by russellm

  • milestone set to 1.0
  • Triage Stage changed from Accepted to Design decision needed

comment:4 follow-up: Changed 7 years ago by russellm

For the record - I'm in favor of this change; It's probably also worth looking at PhoneNumberField (either moving to USPhoneNumberField in localflavor, or reassessing the default widget)

comment:5 Changed 7 years ago by jacob

  • Component changed from Core framework to Database wrapper
  • Triage Stage changed from Design decision needed to Accepted

comment:6 Changed 7 years ago by mattmcc

  • Owner changed from nobody to mattmcc
  • Status changed from new to assigned

Changed 7 years ago by mattmcc

comment:7 follow-up: Changed 7 years ago by mattmcc

  • Has patch set
  • Owner changed from mattmcc to nobody
  • Status changed from assigned to new

Some decisions I didn't make:

  • The Person model in docs/topics/db/models.txt uses a models.USStateField. Leaving it in the example without an import line may cause confusion, but it feels wrong to have the import in a code fragment of that sort.
  • db.backends.*.creation defines a [var]char field for USStateField. Should this now be handled by the field itself via db_type, and the entry removed from the creation modules?
  • gis.utils.layermapping maps a USStateField, but may not care about it after the field is no longer in the default django.db.models.fields collection.

comment:8 in reply to: ↑ 4 Changed 7 years ago by Piotr Lewandowski <django@…>

Replying to russellm:

It's probably also worth looking at PhoneNumberField (either moving to USPhoneNumberField in localflavor, or reassessing the default widget)

Thanks for the good remark - I've opened #8664 for this case.

comment:9 in reply to: ↑ 7 Changed 6 years ago by jacob

Replying to mattmcc:

Some decisions I didn't make:

  • The Person model in docs/topics/db/models.txt uses a models.USStateField. Leaving it in the example without an import line may cause confusion, but it feels wrong to have the import in a code fragment of that sort.

Please add a fix for this in the patch; just throw the import at the top of the code snippet.

  • db.backends.*.creation defines a [var]char field for USStateField. Should this now be handled by the field itself via db_type, and the entry removed from the creation modules?

Yes; please add it to the patch.

  • gis.utils.layermapping maps a USStateField, but may not care about it after the field is no longer in the default django.db.models.fields collection.

It's fine to leave this alone; Justin can clean it up if it bugs him.

Changed 6 years ago by mattmcc

comment:10 Changed 6 years ago by jacob

  • Owner changed from nobody to jacob
  • Status changed from new to assigned

comment:11 Changed 6 years ago by jacob

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in [8819].

comment:12 Changed 4 years ago by ubanus@…

  • Cc ubanus@… removed
  • Easy pickings unset
  • Severity set to Normal
  • Type set to Uncategorized

comment:13 Changed 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

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