PageRenderTime 29ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/django/contrib/localflavor/in_/in_states.py

https://code.google.com/p/mango-py/
Python | 84 lines | 77 code | 0 blank | 7 comment | 4 complexity | eb00d29bf6f8a6d87763fae182548655 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. """
  2. A mapping of state misspellings/abbreviations to normalized abbreviations, and
  3. an alphabetical list of states for use as `choices` in a formfield.
  4. This exists in this standalone file so that it's only imported into memory
  5. when explicitly needed.
  6. """
  7. STATE_CHOICES = (
  8. ('KA', 'Karnataka'),
  9. ('AP', 'Andhra Pradesh'),
  10. ('KL', 'Kerala'),
  11. ('TN', 'Tamil Nadu'),
  12. ('MH', 'Maharashtra'),
  13. ('UP', 'Uttar Pradesh'),
  14. ('GA', 'Goa'),
  15. ('GJ', 'Gujarat'),
  16. ('RJ', 'Rajasthan'),
  17. ('HP', 'Himachal Pradesh'),
  18. ('JK', 'Jammu and Kashmir'),
  19. ('AR', 'Arunachal Pradesh'),
  20. ('AS', 'Assam'),
  21. ('BR', 'Bihar'),
  22. ('CG', 'Chattisgarh'),
  23. ('HR', 'Haryana'),
  24. ('JH', 'Jharkhand'),
  25. ('MP', 'Madhya Pradesh'),
  26. ('MN', 'Manipur'),
  27. ('ML', 'Meghalaya'),
  28. ('MZ', 'Mizoram'),
  29. ('NL', 'Nagaland'),
  30. ('OR', 'Orissa'),
  31. ('PB', 'Punjab'),
  32. ('SK', 'Sikkim'),
  33. ('TR', 'Tripura'),
  34. ('UA', 'Uttarakhand'),
  35. ('WB', 'West Bengal'),
  36. # Union Territories
  37. ('AN', 'Andaman and Nicobar'),
  38. ('CH', 'Chandigarh'),
  39. ('DN', 'Dadra and Nagar Haveli'),
  40. ('DD', 'Daman and Diu'),
  41. ('DL', 'Delhi'),
  42. ('LD', 'Lakshadweep'),
  43. ('PY', 'Pondicherry'),
  44. )
  45. STATES_NORMALIZED = {
  46. 'ka': 'KA',
  47. 'karnatka': 'KA',
  48. 'tn': 'TN',
  49. 'tamilnad': 'TN',
  50. 'tamilnadu': 'TN',
  51. 'andra pradesh': 'AP',
  52. 'andrapradesh': 'AP',
  53. 'andhrapradesh': 'AP',
  54. 'maharastra': 'MH',
  55. 'mh': 'MH',
  56. 'ap': 'AP',
  57. 'dl': 'DL',
  58. 'dd': 'DD',
  59. 'br': 'BR',
  60. 'ar': 'AR',
  61. 'sk': 'SK',
  62. 'kl': 'KL',
  63. 'ga': 'GA',
  64. 'rj': 'RJ',
  65. 'rajastan': 'RJ',
  66. 'rajasthan': 'RJ',
  67. 'hp': 'HP',
  68. 'ua': 'UA',
  69. 'up': 'UP',
  70. 'mp': 'MP',
  71. 'mz': 'MZ',
  72. 'bengal': 'WB',
  73. 'westbengal': 'WB',
  74. 'mizo': 'MZ',
  75. 'orisa': 'OR',
  76. 'odisa': 'OR',
  77. 'or': 'OR',
  78. 'ar': 'AR',
  79. }