Django-cities

Latest version: v0.6.2

Safety actively analyzes 682457 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 9 of 10

1.9.4

- Fixed south migration and PEP8.
- Some code for 2.0 accidently was in the previous release.

1.9.3

Fixed contrib stuff.

1.9.2

Fixed region import for malta.

1.9.1

- Fixed chinese city name_ascii support
- Fixed support for regions without names
- to_search() now automatically called when filtering on
search_names

In 1.9.0, you had to query like::

City.objects.filter(search_names__icontains=to_search('Paris, Fra'))

In 1.9.1, passing the value through to_search() is automatic::

City.objects.filter(search_names__icontains='Paris, Fra')

Keep in mind that 'Paris, Fra' will be converted in 'parisfra',
which is useable against search_names column.

2012-06-07 1.9.0 Added Regions/states

- Run migrations: added Region, for USA state support because for example
there is a city called "Greenville" in almost every state.
- Remove CityAutocompleteWidget, in favor of a google-maps-like
autocomplete channel, which you can use with the normal widget.
- Update your querysets using search_names__icontains=some_value to do
search_names__icontains=cities_light.models.to_ascii(some_value).
- Run: ./manage.py cities_light --noinsert to update data, set
search_names, alternate_names, region ...
- If filtering cities to import with city_items_pre_import, make a matching
signal reciever for region_items_pre_import new signal. For example::

COUNTRIES = ('FR', 'US', 'BE', 'GB', 'ES', 'PT', 'DE', 'NL')

def filter_city_import(sender, items, **kwargs):
if items[8] not in COUNTRIES:
raise cities_light.InvalidItems()
cities_light.signals.city_items_pre_import.connect(filter_city_import)

def filter_region_import(sender, items, **kwargs):
if items[0].split('.')[0] not in COUNTRIES:
raise cities_light.InvalidItems()
cities_light.signals.region_items_pre_import.connect(filter_region_import)

Also there is now a progress bar in the cities_light command.

Note that the cities_light command now has very performant implementation
of alternateNames parser, which opens possibilities:

- it parses postal codes, but doesn't do anything with them yet
- it parses the name of every country/region/city in any language, used
only for search_names in this version

For 2.0, we aim at:

- including cities_light.contrib.postal_codes,
- including po files with the translation for every country/region/city
name

Contributions are really welcome so please if you need any of these
features don't hesitate to implement and do pull requests !

1.5.1

We had to fix migration 0003 for mysql. So to upgrade from 1.3, 1.4, or 1.5
to 1.5.1, do::

./manage.py migrate cities_light 0002
pip install -U django-cities-light
./manage.py migrate cities_light

1.1

Backward compatibility breaks:
- cities_light.widgets moved to
cities_light.contrib.autocomplete_light_widgets,

- cities_light.lookups moved to
cities_light.contrib.ajax_selects_lookups,

- cities_light.autocomplete_light_registry moved to
cities_light.contrib.autocomplete_light_channels,

- cities_light does not auto-register channels anymore (because you now
have the choice between a basic channel and the remote channel.

New features:

- latitude and longitude fields,
- search_names,
- djangorestframework integration,
- autocomplete_light+djangorestframework integration.

New author:

- Riccardo Magliocchetti

Page 9 of 10

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.