mysociety/mzalendo — pull request #687 by evdb (2013-07-29 16:33:20+00:00)
Title: Issues/662 za create place objects for mapit areas

Closes #662

To actually make the changes on the ZA vhost the following will need to be done:

There are some district municipalities that have the same name as metropolitan municipalities and this leads to a unique error as the code tries to create a new entry with a slug matching an existing one. Easiest solution is to rename the DM's with slugs ending '-dm':

buffalo-city-dm
city-of-cape-town-dm
city-of-johannesburg-dm
city-of-tshwane-dm
ekurhuleni-dm
ethekwini-dm
mangaung-dm
nelson-mandela-bay-dm
pixley-ka-seme-dm

Commands to run to create the places:

./manage.py core_create_places_from_mapit_entries PRV
./manage.py core_create_places_from_mapit_entries DMN
./manage.py core_create_places_from_mapit_entries MMN
./manage.py core_create_places_from_mapit_entries LMN
./manage.py core_create_places_from_mapit_entries WRD

Afterwards you can assign the parents based on the areas in mapit. I'm **not sure this is correct** as I don't understand whe area hierarchy in South Africa, but something like the following is a good place to start:

./manage.py core_set_area_parents wards:local-municipality
./manage.py core_set_area_parents local-municipality:metropolitan-municipality
./manage.py core_set_area_parents metropolitan-municipality:district-municipality
./manage.py core_set_area_parents district-municipality:province