Opened 10 years ago

Closed 10 years ago

#2455 closed enhancement (fixed)

USStateField to show list of US states in admin

Reported by: anonymous Owned by: Adrian Holovaty
Component: Forms Version:
Severity: normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

Here's a patch to db/models/fields/__init__.py that allows displaying a select box containing all US states in admin.

  • Mikko Nylén

Attachments (2)

usstates.patch (1.9 KB) - added by anonymous 10 years ago.
states.py (1.7 KB) - added by tvon@… 10 years ago.
A choices-friendly list of US states

Download all attachments as: .zip

Change History (8)

Changed 10 years ago by anonymous

Attachment: usstates.patch added

comment:1 Changed 10 years ago by anonymous

Summary: USStateField to show list of US states in admin[patch] USStateField to show list of US states in admin

comment:2 Changed 10 years ago by Adrian Holovaty

Status: newassigned

Thanks for this patch. It's probably a bit out of place for Django's database layer to include an entire list of American states and territories, though, so this is a good excuse to move USStateField into django.contrib.usa or something like that.

Changed 10 years ago by tvon@…

Attachment: states.py added

A choices-friendly list of US states

comment:3 Changed 10 years ago by tvon@…

Please ignore my redundant attachment.

comment:4 Changed 10 years ago by Gary Wilson <gary.wilson@…>

Component: Admin interfacedjango.newforms
Patch needs improvement: set
Summary: [patch] USStateField to show list of US states in adminUSStateField to show list of US states in admin
Triage Stage: UnreviewedDesign decision needed

Maybe needs discussion on where this should go. Adrian has made a suggestion. There are some other fields that would also fit into that category, like #1466.

comment:5 Changed 10 years ago by Adrian Holovaty

(In [4525]) Implented newforms USStateField in django.contrib.localflavor.usa. Refs #2455

comment:6 Changed 10 years ago by Adrian Holovaty

Resolution: fixed
Status: assignedclosed

(In [4545]) Fixed #2455 -- Added newforms USStateSelect widget in django.contrib.localflavor.usa

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