Created
April 20, 2021 19:48
-
-
Save zengoma/5f649edb3c4ac922f78564231ba8d1e1 to your computer and use it in GitHub Desktop.
US alpha-code TextChoices for Django
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.models import TextChoices | |
class USStates(TextChoices): | |
ALABAMA = "AL" | |
ALASKA = "AK" | |
ARIZONA = "AZ" | |
ARKANSAS = "AR" | |
CALIFORNIA = "CA" | |
COLORADO = "CO" | |
CONNECTICUT = "CT" | |
DELAWARE = "DE" | |
DISTRICT_OF_COLUMBIA = "DC" | |
FLORIDA = "FL" | |
GEORGIA = "GA" | |
HAWAII = "HI" | |
IDAHO = "ID" | |
ILLINOIS = "IL" | |
INDIANA = "IN" | |
IOWA = "IA" | |
KANSAS = "KS" | |
KENTUCKY = "KY" | |
LOUISIANA = "LA" | |
MAINE = "ME" | |
MARYLAND = "MD" | |
MASSACHUSETTS = "MA" | |
MICHIGAN = "MI" | |
MINNESOTA = "MN" | |
MISSISSIPPI = "MS" | |
MISSOURI = "MO" | |
MONTANA = "MT" | |
NEBRASKA = "NE" | |
NEVADA = "NV" | |
NEW_HAMPSHIRE = "NH" | |
NEW_JERSEY = "NJ" | |
NEW_MEXICO = "NM" | |
NEW_YORK = "NY" | |
NORTH_CAROLINA = "NC" | |
NORTH_DAKOTA = "ND" | |
OHIO = "OH" | |
OKLAHOMA = "OK" | |
OREGON = "OR" | |
PENNSYLVANIA = "PA" | |
RHODE_ISLAND = "RI" | |
SOUTH_CAROLINA = "SC" | |
SOUTH_DAKOTA = "SD" | |
TENNESSEE = "TN" | |
TEXAS = "TX" | |
UTAH = "UT" | |
VERMONT = "VT" | |
VIRGINIA = "VA" | |
WASHINGTON = "WA" | |
WEST_VIRGINIA = "WV" | |
WISCONSIN = "WI" | |
WYOMING = "WY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment