Skip to content

Commit 000772a

Browse files
committed
Merge branch 'master' into Ukrainian-localflavor
2 parents fbb975e + d53778d commit 000772a

135 files changed

Lines changed: 106662 additions & 46076 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,17 @@ matrix:
3636
env: TOXENV=py35-1.10
3737
- python: 3.5
3838
env: TOXENV=py35-master
39+
- python: 3.6
40+
env: TOXENV=py36-master
3941
allow_failures:
4042
- python: 2.7
4143
env: TOXENV=py27-master
4244
- python: 3.4
4345
env: TOXENV=py34-master
4446
- python: 3.5
4547
env: TOXENV=py35-master
48+
- python: 3.6
49+
env: TOXENV=py36-master
4650
install:
4751
- pip wheel -r tests/requirements.txt codecov
4852
# virtualenv>=14.0.0 has dropped Python 3.2 support

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Package Index: https://pypi.python.org/pypi/django-localflavor
3333
You're encouraged to use the latest version of this package unless you need
3434
support for an unsupported version of Django.
3535

36+
**2017-01-03 - 1.4**: Django 1.8 - 1.10
37+
3638
**2016-05-06 - 1.3**: Django 1.7 - 1.9
3739

3840
**2015-11-27 - 1.2**: Django 1.5 - 1.9

docs/authors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Authors
6868
* Michał Sałaban
6969
* Mike Lissner
7070
* Olivier Sels
71+
* Paul Donohue
7172
* Paulo Poiati
7273
* Rael Max
7374
* Ramiro Morales

docs/changelog.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Other changes:
2222

2323
- None
2424

25-
1.4 (unreleased)
25+
1.4 (2017-01-03)
2626
------------------
2727

2828
New flavors:
@@ -72,10 +72,13 @@ Other changes:
7272
- Ensure the migration framework generates schema migrations for model fields that change the max_length
7373
(`gh-257 <https://github.com/django/django-localflavor/pull/257>`_). Users will need to generate migrations for any
7474
model fields they use with 'makemigrations'.
75-
75+
- Lazily generate US_STATES, STATE_CHOICES, and USPS_CHOICES
76+
(`gh-203 <https://github.com/django/django-localflavor/issues/203>`_
77+
`gh-272 <https://github.com/django/django-localflavor/pull/272>`_).
7678
- Deprecated Phone Number fields
77-
(`gh-262 <https://github.com/django/django-localflavor/pull/262>`_)
78-
79+
(`gh-262 <https://github.com/django/django-localflavor/pull/262>`_).
80+
- Bumped versions of requirements for testing
81+
(`gh-274 <https://github.com/django/django-localflavor/pull/274>`_).
7982

8083
1.3 (2016-05-06)
8184
------------------

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ We might have an extra release if there are enough features in between django re
210210
=========== =========== ===============
211211
Version Django Date
212212
=========== =========== ===============
213-
1.4 1.10 December 2016
213+
1.4 1.10 January 2017
214214
1.x ... ...
215215
2.0 2.0 January 2018
216216
=========== =========== ===============

docs/localflavor/us.rst

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Data
1818

1919
.. autodata:: localflavor.us.us_states.CONTIGUOUS_STATES
2020

21-
.. autodata:: localflavor.us.us_states.US_STATES
21+
.. autodata:: localflavor.us.us_states.NON_CONTIGUOUS_STATES
2222

2323
.. autodata:: localflavor.us.us_states.US_TERRITORIES
2424

@@ -28,8 +28,82 @@ Data
2828

2929
.. autodata:: localflavor.us.us_states.OBSOLETE_STATES
3030

31-
.. autodata:: localflavor.us.us_states.STATE_CHOICES
31+
.. data:: localflavor.us.us_states.US_STATES
32+
:annotation: = CONTIGUOUS_STATES + NON_CONTIGUOUS_STATES
3233

33-
.. autodata:: localflavor.us.us_states.USPS_CHOICES
34+
All US states.
35+
36+
This tuple is lazily generated and may not work as expected in all cases due
37+
to tuple optimizations in the Python interpreter which do not account for
38+
lazily generated tuples. For example::
39+
40+
US_STATES + ('XX', _('Select a State'))
41+
42+
should work as expected, but::
43+
44+
('XX', _('Select a State')) + US_STATES
45+
46+
may throw:
47+
48+
``TypeError: can only concatenate tuple (not "proxy") to tuple``
49+
50+
due to a Python optimization that causes the concatenation to occur before
51+
US_STATES has been lazily generated. To work around these issues, you
52+
can use a slice index (``[:]``) to force the generation of US_STATES
53+
before any other operations are processed by the Python interpreter::
54+
55+
('XX', _('Select a State')) + US_STATES[:]
56+
57+
.. data:: localflavor.us.us_states.STATE_CHOICES
58+
:annotation: = CONTIGUOUS_STATES + NON_CONTIGUOUS_STATES + US_TERRITORIES + ARMED_FORCES_STATES
59+
60+
All US states and territories plus DC and military mail.
61+
62+
This tuple is lazily generated and may not work as expected in all cases due
63+
to tuple optimizations in the Python interpreter which do not account for
64+
lazily generated tuples. For example::
65+
66+
STATE_CHOICES + ('XX', _('Select a State'))
67+
68+
should work as expected, but::
69+
70+
('XX', _('Select a State')) + STATE_CHOICES
71+
72+
may throw:
73+
74+
``TypeError: can only concatenate tuple (not "proxy") to tuple``
75+
76+
due to a Python optimization that causes the concatenation to occur before
77+
STATE_CHOICES has been lazily generated. To work around these issues, you
78+
can use a slice index (``[:]``) to force the generation of STATE_CHOICES
79+
before any other operations are processed by the Python interpreter::
80+
81+
('XX', _('Select a State')) + STATE_CHOICES[:]
82+
83+
.. data:: localflavor.us.us_states.USPS_CHOICES
84+
:annotation: = CONTIGUOUS_STATES + NON_CONTIGUOUS_STATES + US_TERRITORIES + ARMED_FORCES_STATES + COFA_STATES
85+
86+
All US Postal Service locations.
87+
88+
This tuple is lazily generated and may not work as expected in all cases due
89+
to tuple optimizations in the Python interpreter which do not account for
90+
lazily generated tuples. For example::
91+
92+
USPS_CHOICES + ('XX', _('Select a State'))
93+
94+
should work as expected, but::
95+
96+
('XX', _('Select a State')) + USPS_CHOICES
97+
98+
may throw:
99+
100+
``TypeError: can only concatenate tuple (not "proxy") to tuple``
101+
102+
due to a Python optimization that causes the concatenation to occur before
103+
USPS_CHOICES has been lazily generated. To work around these issues, you
104+
can use a slice index (``[:]``) to force the generation of USPS_CHOICES
105+
before any other operations are processed by the Python interpreter::
106+
107+
('XX', _('Select a State')) + USPS_CHOICES[:]
34108

35109
.. autodata:: localflavor.us.us_states.STATES_NORMALIZED

localflavor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.3'
1+
__version__ = '1.4'
-189 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)